]> git.kaiwu.me - nginx.git/commitdiff
fix case when URL has no port, but has ":" in URI part,
authorIgor Sysoev <igor@sysoev.ru>
Fri, 24 Oct 2008 15:12:11 +0000 (15:12 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Fri, 24 Oct 2008 15:12:11 +0000 (15:12 +0000)
the bug has been introduced in r2204

src/core/ngx_inet.c

index 6568cecb730dd8e51b926057f0a4140176000e77..e976c4cdb504a98bad20ad512cdbc8cad15abff7 100644 (file)
@@ -264,7 +264,7 @@ ngx_parse_inet_url(ngx_pool_t *pool, ngx_url_t *u)
 
     port = ngx_strlchr(host, last, ':');
 
-    uri = ngx_strlchr(port ? port : host, last, '/');
+    uri = ngx_strlchr(host, last, '/');
 
     if (uri) {
         if (u->listen || !u->uri_part) {
@@ -276,6 +276,10 @@ ngx_parse_inet_url(ngx_pool_t *pool, ngx_url_t *u)
         u->uri.data = uri;
 
         last = uri;
+
+        if (uri < port) {
+            port = NULL;
+        } 
     }
 
     if (port) {