From e5cba9167b1037c62591ae8602660a6c41a26394 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C5=A0pa=C4=8Dek?= Date: Thu, 1 Aug 2024 02:41:15 +0200 Subject: [PATCH] Log the full request URL in Resource Isolation Policy Logging Follow-up to #373 #371 --- site/app/Http/FetchMetadata/ResourceIsolationPolicy.php | 3 ++- site/tests/Http/FetchMetadata/ResourceIsolationPolicyTest.phpt | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/site/app/Http/FetchMetadata/ResourceIsolationPolicy.php b/site/app/Http/FetchMetadata/ResourceIsolationPolicy.php index ea3ec145b..7541f4f33 100644 --- a/site/app/Http/FetchMetadata/ResourceIsolationPolicy.php +++ b/site/app/Http/FetchMetadata/ResourceIsolationPolicy.php @@ -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), diff --git a/site/tests/Http/FetchMetadata/ResourceIsolationPolicyTest.phpt b/site/tests/Http/FetchMetadata/ResourceIsolationPolicyTest.phpt index a821efb43..5203eb18a 100644 --- a/site/tests/Http/FetchMetadata/ResourceIsolationPolicyTest.phpt +++ b/site/tests/Http/FetchMetadata/ResourceIsolationPolicyTest.phpt @@ -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()); }