summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2013-02-11 15:31:10 +0000
committerMaxim Dounin <mdounin@mdounin.ru>2013-02-11 15:31:10 +0000
commite8ef9ea62b0b393455bf6fcd588c8ccf5ff72e74 (patch)
treec27451dc4c0eb7411ca57275cbc74dea3fd8b04d
parentad45350460d20403f066df5c9cc0eac37e9bea90 (diff)
downloadnginx-e8ef9ea62b0b393455bf6fcd588c8ccf5ff72e74.tar.gz
nginx-e8ef9ea62b0b393455bf6fcd588c8ccf5ff72e74.tar.bz2
Merge of r5013: 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.
-rw-r--r--src/http/modules/ngx_http_proxy_module.c9
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 455f27aec..977bed73c 100644
--- a/src/http/modules/ngx_http_proxy_module.c
+++ b/src/http/modules/ngx_http_proxy_module.c
@@ -2608,7 +2608,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;
@@ -2907,10 +2907,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++;
}