Skip to content

Commit 2b397a2

Browse files
authored
Add request attribute indicating whether the body has been parsed
1 parent 3be8bac commit 2b397a2

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/HttpWorker.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ private function hydrateRequest(Request $request, array $context): void
157157
$request->cookies = (array)($context['cookies'] ?? []);
158158
$request->uploads = (array)($context['uploads'] ?? []);
159159
$request->parsed = (bool)$context['parsed'];
160+
161+
$request->attributes[Request::PARSED_BODY_ATTRIBUTE_NAME] = $request->parsed;
160162
}
161163

162164
/**

src/Request.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
#[Immutable]
3434
final class Request
3535
{
36+
public const PARSED_BODY_ATTRIBUTE_NAME = 'rr_parsed_body';
37+
3638
/**
3739
* @var string
3840
*/

0 commit comments

Comments
 (0)