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

CONTENT_TYPE and CONTENT_LENGTH headers are incorrectly prepended with HTTP_ #13

Open
mthaak opened this issue Jan 20, 2021 · 0 comments

Comments

@mthaak
Copy link

mthaak commented Jan 20, 2021

Bottle stores these two headers without the HTTP_ prefix (see https://github.com/bottlepy/bottle/blob/f9b1849db4dd724e36a93a1032be592193fba581/bottle.py#L2289). But boddle doesn't make this exception, see:

environ['HTTP_'+k] = v

Which means that this fails:

with boddle(headers={'Content-Type': 'application/json'}):
    content_type = bottle.request.headers['Content-Type'] # this line fails

Because the header is stored as HTTP_CONTENT_TYPE by boddle, but bottle looks for CONTENT_TYPE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant