5
5
*
6
6
* (c) Fabien Potencier <fabien@symfony.com>
7
7
*
8
+ * For the full copyright and license information, please view the LICENSE
9
+ * file that was distributed with this source code.
10
+ */
11
+
12
+ /*
8
13
* This code is partially based on the Rack-Cache library by Ryan Tomayko,
9
14
* which is released under the MIT license.
10
15
* (based on commit 02d2b48d75bcb63cf1c0c7149c077ad256542801)
11
- *
12
- * For the full copyright and license information, please view the LICENSE
13
- * file that was distributed with this source code.
14
16
*/
15
17
16
18
namespace Symfony \Component \HttpKernel \HttpCache ;
@@ -362,7 +364,7 @@ protected function validate(Request $request, Response $entry, bool $catch = fal
362
364
363
365
// add our cached last-modified validator
364
366
if ($ entry ->headers ->has ('Last-Modified ' )) {
365
- $ subRequest ->headers ->set ('if_modified_since ' , $ entry ->headers ->get ('Last-Modified ' ));
367
+ $ subRequest ->headers ->set ('If-Modified-Since ' , $ entry ->headers ->get ('Last-Modified ' ));
366
368
}
367
369
368
370
// Add our cached etag validator to the environment.
@@ -371,7 +373,7 @@ protected function validate(Request $request, Response $entry, bool $catch = fal
371
373
$ cachedEtags = $ entry ->getEtag () ? [$ entry ->getEtag ()] : [];
372
374
$ requestEtags = $ request ->getETags ();
373
375
if ($ etags = array_unique (array_merge ($ cachedEtags , $ requestEtags ))) {
374
- $ subRequest ->headers ->set ('if_none_match ' , implode (', ' , $ etags ));
376
+ $ subRequest ->headers ->set ('If-None-Match ' , implode (', ' , $ etags ));
375
377
}
376
378
377
379
$ response = $ this ->forward ($ subRequest , $ catch , $ entry );
@@ -422,8 +424,8 @@ protected function fetch(Request $request, bool $catch = false): Response
422
424
}
423
425
424
426
// avoid that the backend sends no content
425
- $ subRequest ->headers ->remove ('if_modified_since ' );
426
- $ subRequest ->headers ->remove ('if_none_match ' );
427
+ $ subRequest ->headers ->remove ('If-Modified-Since ' );
428
+ $ subRequest ->headers ->remove ('If-None-Match ' );
427
429
428
430
$ response = $ this ->forward ($ subRequest , $ catch );
429
431
0 commit comments