fix case when URL has no port, but has ":" in URI part,

the bug has been introduced in r2204
This commit is contained in:
Igor Sysoev 2008-10-24 15:12:11 +00:00
parent 571a5e1512
commit c239da5055

View File

@ -264,7 +264,7 @@ ngx_parse_inet_url(ngx_pool_t *pool, ngx_url_t *u)
port = ngx_strlchr(host, last, ':'); port = ngx_strlchr(host, last, ':');
uri = ngx_strlchr(port ? port : host, last, '/'); uri = ngx_strlchr(host, last, '/');
if (uri) { if (uri) {
if (u->listen || !u->uri_part) { 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; u->uri.data = uri;
last = uri; last = uri;
if (uri < port) {
port = NULL;
}
} }
if (port) { if (port) {