aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_request.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2007-12-01 11:46:04 +0000
committerIgor Sysoev <igor@sysoev.ru>2007-12-01 11:46:04 +0000
commit1d4e9b31cc78b355fa8b0b7d37d6d0d537fe49d4 (patch)
tree922caf490abf46a1becb87626ccf2354852944a6 /src/http/ngx_http_request.c
parent4d65f6501a3f08314274eb9dee1c94909dfeb1ec (diff)
downloadnginx-1d4e9b31cc78b355fa8b0b7d37d6d0d537fe49d4.tar.gz
nginx-1d4e9b31cc78b355fa8b0b7d37d6d0d537fe49d4.zip
do not allow plain 0.9 request to HTTPS
Diffstat (limited to 'src/http/ngx_http_request.c')
-rw-r--r--src/http/ngx_http_request.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c
index e63418306..5ecdf1204 100644
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -1335,13 +1335,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 =
@@ -1409,6 +1402,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) {