Forums

Getting HTTP/1.1 response for HTTP/1.0 request

This is not a big issue and I was able to bypass but still a bit puzzling to me.

I have a client that issues HTTP/1.0 requests to a web app and checks the response for "HTTP/1.0" . If response is not HTTP/1.0 it is considered an bad and discarded.

The client logs the request it constructs before sending it, as well as the response it recieved in case of an error. I also have web app access logs.

When I run locally with django's runserver it is working well, I get the following logs:

client:

2016-04-03 22:08:00,119 INFO [default] Buffer: GET /allocate HTTP/1.0

server:

[03/Apr/2016 22:08:00] "GET /allocate HTTP/1.0" 200 56

When I run the same client It fails with and error and I get the following logs:

client:

2016-04-03 21:53:01,361 INFO [default] Buffer: GET /allocate HTTP/1.0

2016-04-03 21:53:01,681 ERROR [default] Bad response: HTTP/1.1 200 OK

Server: ngx_openresty/1.4.3.6

Date: Sun, 03 Apr 2016 18:53:01 GMT

Content-Type: text/html; charset=utf-8

Connection: close

Vary: Accept-Encoding

X-Frame-Options: SAMEORIGIN

X-Clacks-Overhead: GNU Terry Pratchett

<br>

2.1 Ytok88FPIOxbDKLE4AwCVEjVUaNIv97S 5 29 19 15150145 15161790

server:

11.111.111.111 - - [03/Apr/2016:18:53:01 +0000] "GET /allocate HTTP/1.1" 200 73 "-" "-" "11.111.111.111"

It looks like that not only the server response with the wrong http version, it also rewrites the request itself? Am I correct? Is this behavior intentional?

Hm. This is lower-level stuff than what I am used to, but a quick search suggests that it's the expected behaviour from the server?

https://serverfault.com/questions/442960/nginx-ignoring-clients-http-1-0-request-and-respond-by-http-1-1

Is that how you read it as well?

Indeed, that solves the mystery. I guess that according to this, django's runserver is only HTTP/1.0 compatible.