Mercurial > hg > nginx
comparison src/http/ngx_http_request.c @ 1733:7b074520602f stable-0.5
r1677 merge:
do not allow plain 0.9 request to HTTPS
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Wed, 12 Dec 2007 21:09:17 +0000 |
parents | 9e04d3259096 |
children | b4d3c9c1ae20 |
comparison
equal
deleted
inserted
replaced
1732:6795ed69e472 | 1733:7b074520602f |
---|---|
1330 "client sent \"Transfer-Encoding: chunked\" header"); | 1330 "client sent \"Transfer-Encoding: chunked\" header"); |
1331 ngx_http_finalize_request(r, NGX_HTTP_LENGTH_REQUIRED); | 1331 ngx_http_finalize_request(r, NGX_HTTP_LENGTH_REQUIRED); |
1332 return NGX_ERROR; | 1332 return NGX_ERROR; |
1333 } | 1333 } |
1334 | 1334 |
1335 if (r->plain_http) { | |
1336 ngx_log_error(NGX_LOG_INFO, r->connection->log, 0, | |
1337 "client sent plain HTTP request to HTTPS port"); | |
1338 ngx_http_finalize_request(r, NGX_HTTP_TO_HTTPS); | |
1339 return NGX_ERROR; | |
1340 } | |
1341 | |
1342 if (r->headers_in.connection_type == NGX_HTTP_CONNECTION_KEEP_ALIVE) { | 1335 if (r->headers_in.connection_type == NGX_HTTP_CONNECTION_KEEP_ALIVE) { |
1343 if (r->headers_in.keep_alive) { | 1336 if (r->headers_in.keep_alive) { |
1344 r->headers_in.keep_alive_n = | 1337 r->headers_in.keep_alive_n = |
1345 ngx_atotm(r->headers_in.keep_alive->value.data, | 1338 ngx_atotm(r->headers_in.keep_alive->value.data, |
1346 r->headers_in.keep_alive->value.len); | 1339 r->headers_in.keep_alive->value.len); |
1403 long rc; | 1396 long rc; |
1404 ngx_http_ssl_srv_conf_t *sscf; | 1397 ngx_http_ssl_srv_conf_t *sscf; |
1405 #endif | 1398 #endif |
1406 | 1399 |
1407 c = r->connection; | 1400 c = r->connection; |
1401 | |
1402 if (r->plain_http) { | |
1403 ngx_log_error(NGX_LOG_INFO, c->log, 0, | |
1404 "client sent plain HTTP request to HTTPS port"); | |
1405 ngx_http_finalize_request(r, NGX_HTTP_TO_HTTPS); | |
1406 return; | |
1407 } | |
1408 | 1408 |
1409 #if (NGX_HTTP_SSL) | 1409 #if (NGX_HTTP_SSL) |
1410 | 1410 |
1411 if (c->ssl) { | 1411 if (c->ssl) { |
1412 sscf = ngx_http_get_module_srv_conf(r, ngx_http_ssl_module); | 1412 sscf = ngx_http_get_module_srv_conf(r, ngx_http_ssl_module); |