mirror of
https://github.com/nginx/nginx.git
synced 2024-11-25 18:30:26 -06:00
fix proxy_redirect with variable
This commit is contained in:
parent
347f7fe4c1
commit
c9098081e2
@ -1397,8 +1397,11 @@ ngx_http_proxy_rewrite_redirect_vars(ngx_http_request_t *r, ngx_table_elt_t *h,
|
||||
e.ip = pr->replacement.vars.lengths;
|
||||
e.request = r;
|
||||
|
||||
for (len = prefix; *(uintptr_t *) e.ip; len += lcode(&e)) {
|
||||
len = prefix + h->value.len - pr->redirect.len;
|
||||
|
||||
while (*(uintptr_t *) e.ip) {
|
||||
lcode = *(ngx_http_script_len_code_pt *) e.ip;
|
||||
len += lcode(&e);
|
||||
}
|
||||
|
||||
data = ngx_palloc(r->pool, len);
|
||||
@ -1418,6 +1421,9 @@ ngx_http_proxy_rewrite_redirect_vars(ngx_http_request_t *r, ngx_table_elt_t *h,
|
||||
code(&e);
|
||||
}
|
||||
|
||||
ngx_memcpy(e.pos, h->value.data + prefix + pr->redirect.len,
|
||||
h->value.len - pr->redirect.len - prefix);
|
||||
|
||||
h->value.len = len;
|
||||
h->value.data = data;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user