aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2009-03-14 19:20:34 +0000
committerIgor Sysoev <igor@sysoev.ru>2009-03-14 19:20:34 +0000
commitbb7d615b3cbd7daa6b5195711427e374afa47c3a (patch)
tree005e7b76a960aa4b61959581bbddc4de6d7677e4
parent51ed97f79f36b4286577e0bda8822fbc18d11df6 (diff)
downloadnginx-bb7d615b3cbd7daa6b5195711427e374afa47c3a.tar.gz
nginx-bb7d615b3cbd7daa6b5195711427e374afa47c3a.zip
fix reserved mapped uri length if alias has captures
-rw-r--r--src/http/ngx_http_core_module.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
index 3af15de18..2d4feab75 100644
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -1672,13 +1672,11 @@ ngx_http_map_uri_to_path(ngx_http_request_t *r, ngx_str_t *path,
return NULL;
}
- reserved += r->uri.len - alias + 1;
-
if (clcf->root_lengths == NULL) {
*root_length = clcf->root.len;
- path->len = clcf->root.len + reserved;
+ path->len = clcf->root.len + reserved + r->uri.len - alias + 1;
path->data = ngx_pnalloc(r->pool, path->len);
if (path->data == NULL) {
@@ -1688,7 +1686,7 @@ ngx_http_map_uri_to_path(ngx_http_request_t *r, ngx_str_t *path,
last = ngx_copy(path->data, clcf->root.data, clcf->root.len);
} else {
- if (ngx_http_script_run(r, path, clcf->root_lengths->elts, reserved,
+ if (ngx_http_script_run(r, path, clcf->root_lengths->elts, ++reserved,
clcf->root_values->elts)
== NULL)
{