Skip to content

Commit 42c96a0

Browse files
authored
Merge pull request #485 from FriendsOfSymfony/update-master-from-1.4
Merging 1.4 into master
2 parents a432c98 + 6e39324 commit 42c96a0

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@ Changelog
33

44
See also the [GitHub releases page](https://github.com/FriendsOfSymfony/FOSHttpCache/releases).
55

6+
unreleased
7+
----------
8+
9+
### Symfony HttpCache
10+
11+
* Added a neutral "Bad Request" body to user hash mismatch response to have
12+
something searchable in the code when debugging.
13+
614
2.9.2
715
-----
816

@@ -313,6 +321,12 @@ See also the [GitHub releases page](https://github.com/FriendsOfSymfony/FOSHttpC
313321
tags are formatted, use the new `header_formatter` option with a
314322
`TagHeaderFormatter`.
315323

324+
1.4.6
325+
-----
326+
327+
* [Symfony HttpCache] Added a neutral "Bad Request" body to user hash mismatch
328+
response to have something searchable in the code when debugging.
329+
316330
1.4.5
317331
-----
318332

src/SymfonyCache/UserContextListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public function preHandle(CacheEvent $event)
113113
if ($request->headers->get('accept') === $this->options['user_hash_accept_header']
114114
|| null !== $request->headers->get($this->options['user_hash_header'])
115115
) {
116-
$event->setResponse(new Response('', 400));
116+
$event->setResponse(new Response('Bad Request', 400));
117117

118118
return;
119119
}

tests/Unit/SymfonyCache/UserContextListenerTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ public function testGenerateUserHashNotAllowed($arg, $options)
7676

7777
$this->assertInstanceOf(Response::class, $response);
7878
$this->assertSame(400, $response->getStatusCode());
79+
$this->assertSame('Bad Request', $response->getContent());
7980
}
8081

8182
/**
@@ -94,6 +95,7 @@ public function testPassingUserHashNotAllowed($arg, $options)
9495

9596
$this->assertInstanceOf(Response::class, $response);
9697
$this->assertSame(400, $response->getStatusCode());
98+
$this->assertSame('Bad Request', $response->getContent());
9799
}
98100

99101
/**

0 commit comments

Comments
 (0)