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

Cookie header validation works on gunicorn, does not on NGINX #91

Open
william-oxman opened this issue Sep 23, 2020 · 0 comments
Open

Comments

@william-oxman
Copy link

While I'm aware this probably does not imply a behavioral change in flask_accepts, it is probably the quickest way for me to get to the bottom of this and potentially contribute some documentation here.

Consider this decorator on a post endpoint:

@accepts( {'name': 'cookie', 'type': str, 'required': True, 'location': 'headers'} ) ...

if gunicorn serves this project, swagger will accept cookies specified as

cookie * string (header)

if nginx serves this project, the following error occurs:
{ "errors": { "cookie": "Missing required parameter in the HTTP headers" }, "message": "Input payload validation failed" }

I'm aware of such differences in servers as underscores in variable names not being accepted by nginx but being accepted by various development servers, for example. Is something similar going on here? It seems good to document this in the case that someone wants to use flask_accepts in a production, nginx-driven environment. I'm happy to 1. document a solution 2. be wrong and told why what I'm doing is a bad idea, and what a better one is!

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