# HG changeset patch # User Maxim Dounin # Date 1358858160 0 # Node ID bbdb172f0927634fff3e85f2a6ad875a338fba82 # Parent 2b71f6535c763df1bc3bad35d715cee90fbdf932 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. diff --git a/src/http/modules/ngx_http_proxy_module.c b/src/http/modules/ngx_http_proxy_module.c --- 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_ * 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 #endif - if (conf->method.len == 0) { - conf->method = prev->method; - - } else { + ngx_conf_merge_str_value(conf->method, prev->method, ""); + + if (conf->method.len + && conf->method.data[conf->method.len - 1] != ' ') + { conf->method.data[conf->method.len] = ' '; conf->method.len++; }