python-oauth2 icon indicating copy to clipboard operation
python-oauth2 copied to clipboard

uppercase 'Authorization' header

Open kmccarthy opened this issue 13 years ago • 1 comments

Integrated python-oauth2 with twisted framework. Twisted sets all headers names to lowercase while the oauth module expects uppercase 'Authorization'. Rather that a hack to revert the header before calling oauth routimes (from_request for example) any suggestions how to better handle this?

kmccarthy avatar May 03 '11 13:05 kmccarthy

Hilarious that this hasn't been touched in a year, despite still being an issue.

Nginx normalizes all headers to the HTTP_*** format, meaning that by the time wsgi/django even has a chance to look at them, the original casing has been lost. This means, in order to prepare headers for oauth2, we need to strip the prefix, replace the underscores with hyphens, and then capitalize the first letter of every word.

This is very silly, seeing as http headers are defined by spec as being case-insensitive. It would be great if oauth2 didn't force users to coerce their data into a specific casing. All header checks should be case insensitive.

dieselmachine avatar Jun 15 '12 23:06 dieselmachine