Closed DaDeather closed 5 years ago
The passed headers are being made ucfirst() by default. Which is unnecessary according to HTTP 1.1 (https://www.w3.org/Protocols/rfc2616/rfc2616.html and which was not changed in https://tools.ietf.org/html/rfc7230#appendix-A.2).
See: https://github.com/zendframework/zend-http/blob/master/src/Client/Adapter/Socket.php#L384
We are facing an issue were an API provider is checking for a case sensitive x- header (which of course is not HTTP 1.1 compliant).
$config = [ 'adapter' => 'Zend\Http\Client\Adapter\Socket', 'ssltransport' => 'tls' ]; $client = new Client('http://httpbin.org', $config); $request = new Request(); $request->setUri('http://httpbin.org/get'); $request->setHeaders(Headers::fromString('x-my-test: myTest')); $response = $client->send($request);
The header parameter should have been the way it has been given: x-my-test: myTest
The header is being upper cased for the first char resulting in: X-my-test: myTest
The passed headers are being made ucfirst() by default. Which is unnecessary according to HTTP 1.1 (https://www.w3.org/Protocols/rfc2616/rfc2616.html and which was not changed in https://tools.ietf.org/html/rfc7230#appendix-A.2).
See: https://github.com/zendframework/zend-http/blob/master/src/Client/Adapter/Socket.php#L384
We are facing an issue were an API provider is checking for a case sensitive x- header (which of course is not HTTP 1.1 compliant).
Code to reproduce the issue
Expected results
The header parameter should have been the way it has been given: x-my-test: myTest
Actual results
The header is being upper cased for the first char resulting in: X-my-test: myTest