swapi icon indicating copy to clipboard operation
swapi copied to clipboard

runserver serves with HTTP/1.0

Open sergeysolovev opened this issue 7 years ago • 1 comments

screenshot 2017-06-25 00 10 01

This is a known issue with django, that has been fixed, but not yet in 1.7.4. The problem is, Chrome doesn't work with ETag if the server uses HTTP/1.0.

Are there any plans to upgrade django or we should better consider monkey patching it locally?

sergeysolovev avatar Jun 24 '17 16:06 sergeysolovev

Have found out that the fix in question was moved to release 2.0, that is not ready yet.

Currently, to get HTTP 1.1 responses in dev environment, I would suggest to use gunicorn from required packages:

gunicorn swapi.wsgi --log-file -

It wouldn't serve static files, though dj_static could help. For working with json output from API you might not need static at all.

This way, with HTTP 1.1, it's possible to see the correct work of ETag in dev environment

screenshot 2017-06-25 21 39 00

with the following javascript:

fetch('http://lvh.me:8000/api/')

Here lvh.me is used to make cross-origin request from localhost.

sergeysolovev avatar Jun 25 '17 13:06 sergeysolovev