diff options
author | Maxim Dounin <mdounin@mdounin.ru> | 2013-01-22 12:36:00 +0000 |
---|---|---|
committer | Maxim Dounin <mdounin@mdounin.ru> | 2013-01-22 12:36:00 +0000 |
commit | aa0b86fb4dc70aca429e7f6aa8c6d18b2c5a276e (patch) | |
tree | 571c15c97d16f1f6c5bc1b328e98f8c4ceeae74d /src/http/modules/ngx_http_proxy_module.c | |
parent | f29eb0798b8699f453a7cb4fa7bbc745f00e7eff (diff) | |
download | nginx-aa0b86fb4dc70aca429e7f6aa8c6d18b2c5a276e.tar.gz nginx-aa0b86fb4dc70aca429e7f6aa8c6d18b2c5a276e.zip |
Proxy: fixed proxy_method to always add space.
Before the patch if proxy_method was specified at http{} level the code
to add trailing space wasn't executed, resulting in incorrect requests
to upstream.
Diffstat (limited to 'src/http/modules/ngx_http_proxy_module.c')
-rw-r--r-- | src/http/modules/ngx_http_proxy_module.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/http/modules/ngx_http_proxy_module.c b/src/http/modules/ngx_http_proxy_module.c index a8265732f..ce47a9e34 100644 --- a/src/http/modules/ngx_http_proxy_module.c +++ b/src/http/modules/ngx_http_proxy_module.c @@ -2353,7 +2353,7 @@ ngx_http_proxy_create_loc_conf(ngx_conf_t *cf) * conf->upstream.store_lengths = NULL; * conf->upstream.store_values = NULL; * - * conf->method = NULL; + * conf->method = { 0, NULL }; * conf->headers_source = NULL; * conf->headers_set_len = NULL; * conf->headers_set = NULL; @@ -2657,10 +2657,11 @@ ngx_http_proxy_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child) #endif - if (conf->method.len == 0) { - conf->method = prev->method; + ngx_conf_merge_str_value(conf->method, prev->method, ""); - } else { + if (conf->method.len + && conf->method.data[conf->method.len - 1] != ' ') + { conf->method.data[conf->method.len] = ' '; conf->method.len++; } |