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)
324324 }
325325
326326 // 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 ' )) {
328328 $ headers ->set ('pragma ' , 'no-cache ' );
329329 $ headers ->set ('expires ' , -1 );
330330 }
Original file line number Diff line number Diff line change @@ -581,6 +581,12 @@ public function testPrepareSetsPragmaOnHttp10Only()
581581 $ this ->assertEquals ('no-cache ' , $ response ->headers ->get ('pragma ' ));
582582 $ this ->assertEquals ('-1 ' , $ response ->headers ->get ('expires ' ));
583583
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+
584590 $ request ->server ->set ('SERVER_PROTOCOL ' , 'HTTP/1.1 ' );
585591 $ response = new Response ('foo ' );
586592 $ response ->prepare ($ request );
You can’t perform that action at this time.
0 commit comments