changeset 2524:fd4ee75c6eee

name/password were ignored after odd empty lines
author Igor Sysoev <igor@sysoev.ru>
date Mon, 23 Feb 2009 15:31:18 +0000
parents 7764f0fdd2a4
children 11a4e2ed5b16
files src/http/modules/ngx_http_auth_basic_module.c
diffstat 1 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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_req
             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]) {