[nginx] Assume the HTTP/1.0 version by default.

Valentin Bartenev vbart at nginx.com
Mon Sep 2 03:57:18 UTC 2013

details:   http://hg.nginx.org/nginx/rev/62be77b0608f
changeset: 5354:62be77b0608f
user:      Valentin Bartenev <vbart at nginx.com>
date:      Mon Sep 02 03:45:14 2013 +0400
Assume the HTTP/1.0 version by default.

It is believed to be better than fallback to HTTP/0.9, because most of
the clients at present time support HTTP/1.0.  It allows nginx to return
error response code for them in cases when it fail to parse request line,
and therefore fail to detect client protocol version.

Even if the client does not support HTTP/1.0, this assumption should not
cause any harm, since from the HTTP/0.9 point of view it still a valid


 src/http/ngx_http_request.c |  1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diffs (11 lines):

diff -r 1608b1135a1d -r 62be77b0608f src/http/ngx_http_request.c
--- a/src/http/ngx_http_request.c	Fri Aug 30 21:44:16 2013 +0400
+++ b/src/http/ngx_http_request.c	Mon Sep 02 03:45:14 2013 +0400
@@ -571,6 +571,7 @@ ngx_http_create_request(ngx_connection_t
     r->start_msec = tp->msec;
     r->method = NGX_HTTP_UNKNOWN;
+    r->http_version = NGX_HTTP_VERSION_10;
     r->headers_in.content_length_n = -1;
     r->headers_in.keep_alive_n = -1;

More information about the nginx-devel mailing list