diff options
author | Ruslan Ermilov <ru@nginx.com> | 2017-04-25 23:39:13 +0300 |
---|---|---|
committer | Ruslan Ermilov <ru@nginx.com> | 2017-04-25 23:39:13 +0300 |
commit | 8ae2bc932013b838b925cdbb0cae59f743e699c7 (patch) | |
tree | 7c741c9dd1c710fcde3250fc013d78fdb0934c64 /src/http/ngx_http_request.c | |
parent | 53e63ff7c3bef19bd6bba333c3aafad8897869ab (diff) | |
download | nginx-8ae2bc932013b838b925cdbb0cae59f743e699c7.tar.gz nginx-8ae2bc932013b838b925cdbb0cae59f743e699c7.zip |
Don't pretend we support HTTP major versions >1 as HTTP/1.1.
Diffstat (limited to 'src/http/ngx_http_request.c')
-rw-r--r-- | src/http/ngx_http_request.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c index 476f03984..7af45c586 100644 --- a/src/http/ngx_http_request.c +++ b/src/http/ngx_http_request.c @@ -72,6 +72,9 @@ static char *ngx_http_client_errors[] = { /* NGX_HTTP_PARSE_INVALID_REQUEST */ "client sent invalid request", + /* NGX_HTTP_PARSE_INVALID_VERSION */ + "client sent invalid version", + /* NGX_HTTP_PARSE_INVALID_09_METHOD */ "client sent invalid method in HTTP/0.9 request" }; @@ -1036,7 +1039,14 @@ ngx_http_process_request_line(ngx_event_t *rev) ngx_log_error(NGX_LOG_INFO, c->log, 0, ngx_http_client_errors[rc - NGX_HTTP_CLIENT_ERROR]); - ngx_http_finalize_request(r, NGX_HTTP_BAD_REQUEST); + + if (rc == NGX_HTTP_PARSE_INVALID_VERSION) { + ngx_http_finalize_request(r, NGX_HTTP_VERSION_NOT_SUPPORTED); + + } else { + ngx_http_finalize_request(r, NGX_HTTP_BAD_REQUEST); + } + return; } |