From 020aae3300de284cf866f4472a8ec794b073537f Mon Sep 17 00:00:00 2001 From: Alex Kalineskou Date: Thu, 17 Oct 2019 20:10:52 +0300 Subject: [PATCH] [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 --- src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php b/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php index addeca8bae143..ef52e350185d3 100644 --- a/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php +++ b/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php @@ -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