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

web.Response converts headers to uppercase #223

Closed
isaacl opened this issue Jan 7, 2015 · 8 comments
Closed

web.Response converts headers to uppercase #223

isaacl opened this issue Jan 7, 2015 · 8 comments
Labels

Comments

@isaacl
Copy link

isaacl commented Jan 7, 2015

HTTP headers are technically case insensitive but it might be nice to preserve input case for readability.

@kxepal
Copy link
Member

kxepal commented Jan 7, 2015

Good point. I would say more: send headers titled instead of uppercased like they are defined in spec (Content-Type etc.). Turning them all into upper case looks as an ugly hack to simplify key lookup and further comparison.

@asvetlov
Copy link
Member

asvetlov commented Jan 7, 2015

Hmm. Nice to have, but requires deep multidict refactoring.
Please don't start to do it right now: I'm working on accelerated version of multidicts (optional, of course): https://github.com/KeepSafe/aiohttp/blob/cytonize_multidicts/aiohttp/_multidict.pyx

@kxepal
Copy link
Member

kxepal commented Jan 7, 2015

@asvetlov looks cool, but does multidict is really needs in such optimization? I always thought that routing is far much more good candidate for that...anyway, look forward for your work on this!

@asvetlov
Copy link
Member

asvetlov commented Jan 7, 2015

I did profiling.
Router is called once per request, regexps are fast.
But on every requests we have many reads and writes for headers (low-level server also operates with multidicts, BTW).

@isaacl
Copy link
Author

isaacl commented Jan 7, 2015

As @kxepal suggested, we could default to title case instead of upper case. That would avoid changing the actual storage structures, and can be done when formatting the response.

@asvetlov
Copy link
Member

asvetlov commented Jan 8, 2015

@isaacl it requires data structure changing.

@fafhrd91
Copy link
Member

fafhrd91 commented Jan 8, 2015

-1 for camel case. I like capitalized header

On Thursday, January 8, 2015, Andrew Svetlov [email protected]
wrote:

@isaacl https://github.com/isaacl it requires data structure changing.


Reply to this email directly or view it on GitHub
#223 (comment).

@lock
Copy link

lock bot commented Oct 29, 2019

This thread has been automatically locked since there has not been
any recent activity after it was closed. Please open a new issue for
related bugs.

If you feel like there's important points made in this discussion,
please include those exceprts into that new issue.

@lock lock bot added the outdated label Oct 29, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants