Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request headers are lowercased #242

Closed
nicolas-grekas opened this issue Jan 3, 2020 · 5 comments
Closed

Request headers are lowercased #242

nicolas-grekas opened this issue Jan 3, 2020 · 5 comments

Comments

@nicolas-grekas
Copy link
Contributor

@nicolas-grekas nicolas-grekas commented Jan 3, 2020

Same as #164. On Symfony, we've got symfony/symfony#32819 a few months ago.

TL;DR there are API servers that are case sensitive. Yes, this is not HTTP-compliant.
Yet, lowercasing the headers before sending them is not required.
We chose to not lowercase headers when sending them on HTTP/1.x so that the client can still consume those APIs.

I think the Amp client should reconsider and do the same. At least on Symfony's side, the current strict behavior means we're not sure if we can ship Amp's implementation as the default one (when it is installed).

@nicolas-grekas nicolas-grekas changed the title Request headers are lowercases Request headers are lowercased Jan 3, 2020
@trowski

This comment has been minimized.

Copy link
Member

@trowski trowski commented Jan 3, 2020

We could consider adding Request::getOriginalHeaderNames() and Response::getOriginalHeaderNames() so the HTTP/1.x client can use/set those. Thoughts @kelunik?

@kelunik

This comment has been minimized.

Copy link
Member

@kelunik kelunik commented Jan 3, 2020

@nicolas-grekas Before we start implementing this, did you hear any other complaints or was that the only such request?

@nicolas-grekas

This comment has been minimized.

Copy link
Contributor Author

@nicolas-grekas nicolas-grekas commented Jan 3, 2020

That's the only report on the topic. But now that this is fixed, we won't get more...

@kelunik

This comment has been minimized.

Copy link
Member

@kelunik kelunik commented Jan 3, 2020

A related question is whether we want to support specific header ordering. I've stumbled upon this while implementing this in Message.

kelunik added a commit to amphp/http that referenced this issue Jan 3, 2020
@nicolas-grekas

This comment has been minimized.

Copy link
Contributor Author

@nicolas-grekas nicolas-grekas commented Jan 4, 2020

A related question is whether we want to support specific header ordering

Right now ordering is preserved for the first header of each kind, isn't it?
I think that's enough, no need for per header line order preservation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants
You can’t perform that action at this time.