File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change 8282 header ('Location: .. ' , true , 302 );
8383 break ;
8484
85+ case '/304 ' :
86+ header ('Content-Length: 10 ' , true , 304 );
87+ echo '12345 ' ;
88+ return ;
89+
8590 case '/307 ' :
8691 header ('Location: http://localhost:8057/post ' , true , 307 );
8792 break ;
Original file line number Diff line number Diff line change @@ -260,6 +260,17 @@ public function testBadRequestBody()
260260 $ response ->getStatusCode ();
261261 }
262262
263+ public function test304 ()
264+ {
265+ $ client = $ this ->getHttpClient (__FUNCTION__ );
266+ $ response = $ client ->request ('GET ' , 'http://localhost:8057/304 ' , [
267+ 'headers ' => ['If-Match ' => '"abc" ' ],
268+ ]);
269+
270+ $ this ->assertSame (304 , $ response ->getStatusCode ());
271+ $ this ->assertSame ('' , $ response ->getContent (false ));
272+ }
273+
263274 public function testRedirects ()
264275 {
265276 $ client = $ this ->getHttpClient (__FUNCTION__ );
You can’t perform that action at this time.
0 commit comments