From 5336bd878b5addd9ef11ca8b63756ee1679393bc Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Mon, 23 Feb 2009 15:31:18 +0000 Subject: [PATCH] name/password were ignored after odd empty lines --- src/http/modules/ngx_http_auth_basic_module.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/http/modules/ngx_http_auth_basic_module.c b/src/http/modules/ngx_http_auth_basic_module.c index fe9102287..1c2333990 100644 --- a/src/http/modules/ngx_http_auth_basic_module.c +++ b/src/http/modules/ngx_http_auth_basic_module.c @@ -176,9 +176,16 @@ ngx_http_auth_basic_handler(ngx_http_request_t *r) switch (state) { case sw_login: - if (login == 0 && buf[i] == '#') { - state = sw_skip; - break; + if (login == 0) { + + if (buf[i] == '#' || buf[i] == CR) { + state = sw_skip; + break; + } + + if (buf[i] == LF) { + break; + } } if (buf[i] != r->headers_in.user.data[login]) {