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 ;
@@ -382,7 +384,7 @@ protected function validate(Request $request, Response $entry, bool $catch = fal
382
384
383
385
// add our cached last-modified validator
384
386
if ($ entry ->headers ->has ('Last-Modified ' )) {
385
- $ subRequest ->headers ->set ('if_modified_since ' , $ entry ->headers ->get ('Last-Modified ' ));
387
+ $ subRequest ->headers ->set ('If-Modified-Since ' , $ entry ->headers ->get ('Last-Modified ' ));
386
388
}
387
389
388
390
// Add our cached etag validator to the environment.
@@ -391,7 +393,7 @@ protected function validate(Request $request, Response $entry, bool $catch = fal
391
393
$ cachedEtags = $ entry ->getEtag () ? [$ entry ->getEtag ()] : [];
392
394
$ requestEtags = $ request ->getETags ();
393
395
if ($ etags = array_unique (array_merge ($ cachedEtags , $ requestEtags ))) {
394
- $ subRequest ->headers ->set ('if_none_match ' , implode (', ' , $ etags ));
396
+ $ subRequest ->headers ->set ('If-None-Match ' , implode (', ' , $ etags ));
395
397
}
396
398
397
399
$ response = $ this ->forward ($ subRequest , $ catch , $ entry );
@@ -444,8 +446,8 @@ protected function fetch(Request $request, bool $catch = false)
444
446
}
445
447
446
448
// avoid that the backend sends no content
447
- $ subRequest ->headers ->remove ('if_modified_since ' );
448
- $ subRequest ->headers ->remove ('if_none_match ' );
449
+ $ subRequest ->headers ->remove ('If-Modified-Since ' );
450
+ $ subRequest ->headers ->remove ('If-None-Match ' );
449
451
450
452
$ response = $ this ->forward ($ subRequest , $ catch );
451
453
0 commit comments