pyFF
pyFF copied to clipboard
wsgi app picky about accepted mime-types
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:
https://github.com/IdentityPython/pyFF/blob/a17e5435392f1bef5a3d5854fbd2ebbdbfa2dfbe/src/pyff/api.py#L151
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.
Can you re-verify on the master branch.