'HTTP/1.1 301 Moved Permanently',
'Location: http://127.0.0.1:8057/302',
'Content-Type: application/json',
'HTTP/1.1 302 Found',
'Location: http://localhost:8057/',
'Content-Type: application/json',
'HTTP/1.1 200 OK',
'Content-Type: application/json',
];
$filteredHeaders =
array_values(array_filter($response->
getInfo('response_headers'
),
function D
$h) { return \
in_array(substr($h, 0, 4
),
['HTTP', 'Loca', 'Cont'
], true
) && 'Content-Encoding: gzip' !==
$h;
}));
$this->
assertSame($expected,
$filteredHeaders);
} public function testInvalidRedirect() { $client =
$this->
getHttpClient(__FUNCTION__
);
$response =
$client->
request('GET', 'http://localhost:8057/301/invalid'
);
$this->
assertSame(301,
$response->
getStatusCode());