8000 [HttpCache] fixed if-modified-since header default to an empty string… · symfony/symfony@020aae3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 020aae3

Browse files
committed
[HttpCache] fixed if-modified-since header default to an empty string if the last-modified header was not set
The problem I had with this was that the psr http factory would create the request, and would throw an exception because the null value isn't an allowed header value https://github.com/symfony/psr-http-message-bridge/blob/8564bf76630423ced21bbbee189947b90677dcde/Factory/PsrHttpFactory.php#L72 https://github.com/Nyholm/psr7/blob/55ff6b76573f5b242554c9775792bd59fb52e11c/src/MessageTrait.php#L180
1 parent 29cabf9 commit 020aae3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ protected function validate(Request $request, Response $entry, $catch = false)
352352
}
353353

354354
// add our cached last-modified validator
355-
$subRequest->headers->set('if_modified_since', $entry->headers->get('Last-Modified'));
355+
$subRequest->headers->set('if_modified_since', $entry->headers->get('Last-Modified', ''));
356356

357357
// Add our cached etag validator to the environment.
358358
// We keep the etags from the client to handle the case when the client

0 commit comments

Comments
 (0)
0