From: Igor Sysoev Date: Fri, 24 Oct 2008 15:12:11 +0000 (+0000) Subject: fix case when URL has no port, but has ":" in URI part, X-Git-Tag: release-0.7.20~13 X-Git-Url: http://git.kaiwu.me/postgresql/log/contrib/postgres_fdw/NGINX-js-1660x332.png%20%22NGINX%20JavaScript%20Banner%22?a=commitdiff_plain;h=c239da505545b0d90c4a1cbd7b3e14be9ef3c998;p=nginx.git fix case when URL has no port, but has ":" in URI part, the bug has been introduced in r2204 --- diff --git a/src/core/ngx_inet.c b/src/core/ngx_inet.c index 6568cecb7..e976c4cdb 100644 --- a/src/core/ngx_inet.c +++ b/src/core/ngx_inet.c @@ -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) {