File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -324,7 +324,7 @@ public function prepare(Request $request)
324
324
}
325
325
326
326
// Check if we need to send extra expire info headers
327
- if ('1.0 ' == $ this ->getProtocolVersion () && str_contains ($ headers ->get ('Cache-Control ' ), 'no-cache ' )) {
327
+ if ('1.0 ' == $ this ->getProtocolVersion () && str_contains ($ headers ->get ('Cache-Control ' , '' ), 'no-cache ' )) {
328
328
$ headers ->set ('pragma ' , 'no-cache ' );
329
329
$ headers ->set ('expires ' , -1 );
330
330
}
Original file line number Diff line number Diff line change @@ -581,6 +581,12 @@ public function testPrepareSetsPragmaOnHttp10Only()
581
581
$ this ->assertEquals ('no-cache ' , $ response ->headers ->get ('pragma ' ));
582
582
$ this ->assertEquals ('-1 ' , $ response ->headers ->get ('expires ' ));
583
583
584
+ $ response = new Response ('foo ' );
585
+ $ response ->headers ->remove ('cache-control ' );
586
+ $ response ->prepare ($ request );
587
+ $ this ->assertFalse ($ response ->headers ->has ('pragma ' ));
588
+ $ this ->assertFalse ($ response ->headers ->has ('expires ' ));
589
+
584
590
$ request ->server ->set ('SERVER_PROTOCOL ' , 'HTTP/1.1 ' );
585
591
$ response = new Response ('foo ' );
586
592
$ response ->prepare ($ request );
You can’t perform that action at this time.
0 commit comments