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)
311311 }
312312
313313 // 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 ' )) {
315315 $ headers ->set ('pragma ' , 'no-cache ' );
316316 $ headers ->set ('expires ' , -1 );
317317 }
Original file line number Diff line number Diff line change @@ -578,6 +578,12 @@ public function testPrepareSetsPragmaOnHttp10Only()
578578 $ this ->assertEquals ('no-cache ' , $ response ->headers ->get ('pragma ' ));
579579 $ this ->assertEquals ('-1 ' , $ response ->headers ->get ('expires ' ));
580580
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+
581587 $ request ->server ->set ('SERVER_PROTOCOL ' , 'HTTP/1.1 ' );
582588 $ response = new Response ('foo ' );
583589 $ response ->prepare ($ request );
You can’t perform that action at this time.
0 commit comments