Commit 84147bf
authored
fix(http): Enhance setPsr7Request: parse body
Introduce a proper bridge between PSR-7 ServerRequestInterface and Yii Request, including request body parsing.
The setPsr7Request method now:
- extracts the raw Content-Type header (trimming parameters like `charset=UTF-8`);
- resolves an appropriate request parser from `$this->parsers` (or the `'*'` fallback, if configured);
- parses the PSR-7 request body and injects the result into `parsedBody` via `$request->withParsedBody()`;
- wraps the request in `ServerRequestAdapter` while adding the `statelessAppStartTime` header for tracing/debugging;
- updates the PSR-7 adapter for `UploadedFile` via `UploadedFile::setPsr7Adapter()`.
This change:
- aligns PSR-7-based requests with the existing Yii Request behavior regarding body parsing and UploadedFile handling;
- enables stateless application startup time tracing at the PSR-7 request level;
- keeps compatibility with existing Yii request parsers configured in the application.1 parent 0e288e3 commit 84147bf
1 file changed
+28
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
768 | 768 | | |
769 | 769 | | |
770 | 770 | | |
771 | | - | |
| 771 | + | |
772 | 772 | | |
773 | 773 | | |
774 | 774 | | |
| |||
789 | 789 | | |
790 | 790 | | |
791 | 791 | | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
792 | 818 | | |
793 | | - | |
| 819 | + | |
794 | 820 | | |
795 | | - | |
796 | 821 | | |
797 | 822 | | |
798 | 823 | | |
| |||
0 commit comments