diff options
author | Igor Sysoev <igor@sysoev.ru> | 2011-07-30 06:11:46 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2011-07-30 06:11:46 +0000 |
commit | c9468026e769cc38375030cdd33d540bdc8633d5 (patch) | |
tree | 443503f6dafecacfaa51ff1bde4a65717ed9cd93 /src/http/modules/ngx_http_proxy_module.c | |
parent | c2f852c2603558b744928871a40f14fb950742ed (diff) | |
download | nginx-c9468026e769cc38375030cdd33d540bdc8633d5.tar.gz nginx-c9468026e769cc38375030cdd33d540bdc8633d5.zip |
test length of proxy_pass with variables
patch by Lanshun Zhou
Diffstat (limited to 'src/http/modules/ngx_http_proxy_module.c')
-rw-r--r-- | src/http/modules/ngx_http_proxy_module.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/http/modules/ngx_http_proxy_module.c b/src/http/modules/ngx_http_proxy_module.c index 147422af8..495b1743d 100644 --- a/src/http/modules/ngx_http_proxy_module.c +++ b/src/http/modules/ngx_http_proxy_module.c @@ -642,15 +642,17 @@ ngx_http_proxy_eval(ngx_http_request_t *r, ngx_http_proxy_ctx_t *ctx, return NGX_ERROR; } - if (ngx_strncasecmp(proxy.data, (u_char *) "http://", 7) == 0) { - + if (proxy.len > 7 + && ngx_strncasecmp(proxy.data, (u_char *) "http://", 7) == 0) + { add = 7; port = 80; #if (NGX_HTTP_SSL) - } else if (ngx_strncasecmp(proxy.data, (u_char *) "https://", 8) == 0) { - + } else if (proxy.len > 8 + && ngx_strncasecmp(proxy.data, (u_char *) "https://", 8) == 0) + { add = 8; port = 443; r->upstream->ssl = 1; |