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 82
82
header ('Location: .. ' , true , 302 );
83
83
break ;
84
84
85
+ case '/304 ' :
86
+ header ('Content-Length: 10 ' , true , 304 );
87
+ echo '12345 ' ;
88
+ return ;
89
+
85
90
case '/307 ' :
86
91
header ('Location: http://localhost:8057/post ' , true , 307 );
87
92
break ;
Original file line number Diff line number Diff line change @@ -260,6 +260,17 @@ public function testBadRequestBody()
260
260
$ response ->getStatusCode ();
261
261
}
262
262
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
+
263
274
public function testRedirects ()
264
275
{
265
276
$ client = $ this ->getHttpClient (__FUNCTION__ );
You can’t perform that action at this time.
0 commit comments