diff options
author | Igor Sysoev <igor@sysoev.ru> | 2007-12-13 00:09:17 +0300 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2007-12-13 00:09:17 +0300 |
commit | 3b8cfd03a809939adab5a2daa2efd3d322a575db (patch) | |
tree | 82b3104c639829c2fa286f5ada494041948493ad | |
parent | cde7ea838b9853834c6ae0d9e84c7af57af38546 (diff) |
r1677 merge:
do not allow plain 0.9 request to HTTPS
-rw-r--r-- | src/http/ngx_http_request.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c index e5628f23a..96963a0ab 100644 --- a/src/http/ngx_http_request.c +++ b/src/http/ngx_http_request.c @@ -1332,13 +1332,6 @@ ngx_http_process_request_header(ngx_http_request_t *r) return NGX_ERROR; } - if (r->plain_http) { - ngx_log_error(NGX_LOG_INFO, r->connection->log, 0, - "client sent plain HTTP request to HTTPS port"); - ngx_http_finalize_request(r, NGX_HTTP_TO_HTTPS); - return NGX_ERROR; - } - if (r->headers_in.connection_type == NGX_HTTP_CONNECTION_KEEP_ALIVE) { if (r->headers_in.keep_alive) { r->headers_in.keep_alive_n = @@ -1406,6 +1399,13 @@ ngx_http_process_request(ngx_http_request_t *r) c = r->connection; + if (r->plain_http) { + ngx_log_error(NGX_LOG_INFO, c->log, 0, + "client sent plain HTTP request to HTTPS port"); + ngx_http_finalize_request(r, NGX_HTTP_TO_HTTPS); + return; + } + #if (NGX_HTTP_SSL) if (c->ssl) { |