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 @@ -311,7 +311,7 @@ public function prepare(Request $request)
311
311
}
312
312
313
313
// Check if we need to send extra expire info headers
314
- if ('1.0 ' == $ this ->getProtocolVersion () && str_contains ($ headers ->get ('Cache-Control ' ), 'no-cache ' )) {
314
+ if ('1.0 ' == $ this ->getProtocolVersion () && str_contains ($ headers ->get ('Cache-Control ' , '' ), 'no-cache ' )) {
315
315
$ headers ->set ('pragma ' , 'no-cache ' );
316
316
$ headers ->set ('expires ' , -1 );
317
317
}
Original file line number Diff line number Diff line change @@ -578,6 +578,12 @@ public function testPrepareSetsPragmaOnHttp10Only()
578
578
$ this ->assertEquals ('no-cache ' , $ response ->headers ->get ('pragma ' ));
579
579
$ this ->assertEquals ('-1 ' , $ response ->headers ->get ('expires ' ));
580
580
581
+ $ response = new Response ('foo ' );
582
+ $ response ->headers ->remove ('cache-control ' );
583
+ $ response ->prepare ($ request );
584
+ $ this ->assertFalse ($ response ->headers ->has ('pragma ' ));
585
+ $ this ->assertFalse ($ response ->headers ->has ('expires ' ));
586
+
581
587
$ request ->server ->set ('SERVER_PROTOCOL ' , 'HTTP/1.1 ' );
582
588
$ response = new Response ('foo ' );
583
589
$ response ->prepare ($ request );
You can’t perform that action at this time.
0 commit comments