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

wsgi app picky about accepted mime-types #190

Open
mrvanes opened this issue Feb 7, 2020 · 1 comment
Open

wsgi app picky about accepted mime-types #190

mrvanes opened this issue Feb 7, 2020 · 1 comment

Comments

@mrvanes
Copy link
Contributor

mrvanes commented Feb 7, 2020

As discussed on Slack, I file an issue as a reminder of this problem.

On a fresh pyFF deploy (master as of feb 2020) I encountered an unexpected Accept header problem. Chrome sends application/xml as the third option in Accept header, but the wsgi app only parses the first one as can be seen on this line:

accept = str(request.accept).split(',')[0]

wsgi is clearly not intended to be viewed by browser, but that's how developers work. The result is that pyFF chooses the "when accept application/json" pipe instead of the application/xml, even though Chrome says it accepts application/xml. This caused quite some confusion and cost significant time before I understood the solution was as simple as changing my pipe to "when accept text/html" for (browser) testing.

@leifj
Copy link
Contributor

leifj commented Mar 30, 2021

Can you re-verify on the master branch.

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

2 participants