Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nginx/nginx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2008-10-24 23:34:24 +0400
committerIgor Sysoev <igor@sysoev.ru>2008-10-24 23:34:24 +0400
commit164abfb26f0f98155d11d8b41567f5b42575bb04 (patch)
treea1eed2910bb17122dafc36cc6c4c6554fef44a84 /src/core
parentc239da505545b0d90c4a1cbd7b3e14be9ef3c998 (diff)
fix case proxy_pass URL is evaluted to http://host?args
Diffstat (limited to 'src/core')
-rw-r--r--src/core/ngx_inet.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/core/ngx_inet.c b/src/core/ngx_inet.c
index e976c4cdb..35638e53b 100644
--- a/src/core/ngx_inet.c
+++ b/src/core/ngx_inet.c
@@ -251,7 +251,7 @@ ngx_parse_unix_domain_url(ngx_pool_t *pool, ngx_url_t *u)
static ngx_int_t
ngx_parse_inet_url(ngx_pool_t *pool, ngx_url_t *u)
{
- u_char *p, *host, *port, *last, *uri;
+ u_char *p, *host, *port, *last, *uri, *args;
size_t len;
ngx_int_t n;
struct hostent *h;
@@ -266,6 +266,17 @@ ngx_parse_inet_url(ngx_pool_t *pool, ngx_url_t *u)
uri = ngx_strlchr(host, last, '/');
+ args = ngx_strlchr(host, last, '?');
+
+ if (args) {
+ if (uri == NULL) {
+ uri = args;
+
+ } else if (args < uri) {
+ uri = args;
+ }
+ }
+
if (uri) {
if (u->listen || !u->uri_part) {
u->err = "invalid host";