Skip to content

Commit

Permalink
Log the full request URL in Resource Isolation Policy Logging (#378)
Browse files Browse the repository at this point in the history
Follow-up to
- #371
- #373
  • Loading branch information
spaze authored Aug 1, 2024
2 parents 89adf60 + e5cba91 commit 9b0da80
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion site/app/Http/FetchMetadata/ResourceIsolationPolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ public function install(): void
$headers[] = sprintf('%s: %s', $header, $value ?? '[not sent]');
}
$message = sprintf(
'%s %s; param names: %s; headers: %s',
'%s %s; action: %s; param names: %s; headers: %s',
$this->httpRequest->getMethod(),
$this->httpRequest->getUrl()->getAbsoluteUrl(),
$presenter->getAction(true),
implode(', ', array_keys($presenter->getParameters())),
implode(', ', $headers),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class ResourceIsolationPolicyTest extends TestCase
$this->installPolicy(true);
$this->httpRequest->setHeader(FetchMetadataHeader::Site->value, 'cross-site');
$this->callPresenterAction();
Assert::same(['GET :Www:Homepage:default; param names: foo, waldo; headers: Sec-Fetch-Dest: [not sent], Sec-Fetch-Mode: [not sent], Sec-Fetch-Site: cross-site, Sec-Fetch-User: [not sent]'], $this->logger->getLogged());
Assert::same(['GET /; action: :Www:Homepage:default; param names: foo, waldo; headers: Sec-Fetch-Dest: [not sent], Sec-Fetch-Mode: [not sent], Sec-Fetch-Site: cross-site, Sec-Fetch-User: [not sent]'], $this->logger->getLogged());
Assert::same(IResponse::S200_OK, $this->httpResponse->getCode());
}

Expand Down

0 comments on commit 9b0da80

Please sign in to comment.