noirbizarre / flask-restplus

Fully featured framework for fast, easy and documented API development with Flask
http://flask-restplus.readthedocs.org
Other
2.73k stars 507 forks source link

Flask restplus fails on a certain GET call on Chrome - but not elsewhere. #389

Open vvasuki opened 6 years ago

vvasuki commented 6 years ago

We're faced with a very weird issue, reproducible with our code - https://github.com/vedavaapi/vedavaapi_py_api/issues/3 (README and setup script in the same repo).

Observations:

I was unable to figure this out. Appreciate investigation and pointers.

I have checked against the latest flask restplus version as of this moment, having run: sudo pip3 install -U flask-restplus before testing on my local machine. EDIT: I also tried after the below:

 sudo pip3 install git+https://github.com/noirbizarre/flask-restplus@master -U
...
Installing collected packages: flask-restplus
  Found existing installation: flask-restplus 0.10.1
    Uninstalling flask-restplus-0.10.1:
      Successfully uninstalled flask-restplus-0.10.1
  Running setup.py install for flask-restplus ... done
Successfully installed flask-restplus-0.10.1.dev0
****
martijnarts commented 6 years ago

Can you post full request dumps for the failing requests, both through cURL and Chrome?

vvasuki commented 6 years ago

On chrome: image

Curl request: curl -X GET --header 'Accept: application/json' 'https://api.vedavaapi.org/py/ullekhanam/v1/schemas'

martijnarts commented 6 years ago

Reproducible with cURL:

curl -v --header 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8' 'https://api.vedavaapi.org/py/ullekhanam/v1/schemas' -o /dev/null

Probably something in the Accept header is being parsed badly?

vvasuki commented 6 years ago

I am not doing any header parsing at all...

martijnarts commented 6 years ago

Oh I didn't mean to imply that you were parsing it badly, just that something is, sorry! 😅

I bet it's somewhere in Flask/RestPlus.