aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_request.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2005-03-22 16:02:46 +0000
committerIgor Sysoev <igor@sysoev.ru>2005-03-22 16:02:46 +0000
commit4d656dcd0bd6309b0ec76fc444198ed6c2948a8e (patch)
tree67ce201b7d515273fa2a6a617542cece4fa16898 /src/http/ngx_http_request.c
parent3599a1b885533d929315494258fb407765243a95 (diff)
downloadnginx-4d656dcd0bd6309b0ec76fc444198ed6c2948a8e.tar.gz
nginx-4d656dcd0bd6309b0ec76fc444198ed6c2948a8e.zip
nginx-0.1.26-RELEASE importrelease-0.1.26
*) Change: the invalid client header lines are now ignored and logged at the info level. *) Change: the server name is also logged in error log. *) Feature: the ngx_http_auth_basic_module module and the auth_basic and auth_basic_user_file directives.
Diffstat (limited to 'src/http/ngx_http_request.c')
-rw-r--r--src/http/ngx_http_request.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c
index 3876e39e7..461c028d9 100644
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -722,6 +722,7 @@ ngx_http_process_request_headers(ngx_event_t *rev)
{
ssize_t n;
ngx_int_t rc, rv, i;
+ ngx_str_t header;
ngx_table_elt_t *h, **cookie;
ngx_connection_t *c;
ngx_http_request_t *r;
@@ -771,6 +772,19 @@ ngx_http_process_request_headers(ngx_event_t *rev)
if (rc == NGX_OK) {
+ if (r->invalid_header) {
+
+ /* there was error while a header line parsing */
+
+ header.len = r->header_end - r->header_name_start;
+ header.data = r->header_name_start;
+
+ ngx_log_error(NGX_LOG_INFO, rev->log, 0,
+ "client sent invalid header: \"%V\", ignored,",
+ &header);
+ continue;
+ }
+
/* a header line has been parsed successfully */
r->headers_n++;
@@ -2371,6 +2385,11 @@ ngx_http_log_error(ngx_log_t *log, u_char *buf, size_t len)
len -= p - buf;
+ if (ctx->request->server_name.data) {
+ p = ngx_snprintf(p, len, ", host: %V", &ctx->request->server_name);
+ len -= p - buf;
+ }
+
p = ngx_snprintf(p, len, ", URL: \"%V\"", &ctx->request->unparsed_uri);
if (ctx->request->headers_in.referer == NULL) {