Skip to content

[HttpClient] Headers are lowercased #32819

Closed
@numerogeek

Description

@numerogeek

Hello guys !

I'm submitting you the following issue:

Symfony version(s) affected: 4.3.x

Description
When I set some headers to a curl POST request, the keys are lowercased. This is a problem for some API's

        $this->httpClient = HttpClient::create(['headers' => [
            'X-Apple-Header1' => 'someSecretKey',
            'X-Apple-Header2' => 'someSecretKey',
            'X-Apple-Header3' => 'someSecretKey',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ]]);

And it's converted by HttpClient to :

POST /api/endpoint/1 HTTP/1.1
   Host: api.apple.com
   Accept-Encoding: deflate, gzip
   x-apple-header1: someSecretKey
   x-apple-header2: someSecretKey
   x-apple-header3: someSecretKey

Additional context
I'm using the Curl extension

thanks for helping !

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions