Skip to content

Commit

Permalink
[HttpCache] fixed if-modified-since header default to an empty string…
Browse files Browse the repository at this point in the history
… 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
  • Loading branch information
akalineskou committed Oct 17, 2019
1 parent 29cabf9 commit 020aae3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php
Expand Up @@ -352,7 +352,7 @@ protected function validate(Request $request, Response $entry, $catch = false)
}

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

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

0 comments on commit 020aae3

Please sign in to comment.