From fd0fdcca407ae8a3f0dbaafe17483070b9559c75 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Wed, 20 Nov 2024 17:46:13 -0300 Subject: [PATCH] refactor(proxy-wasm) rename call->uri to call->path ...to clarify that it matches `":path"` (that is, path including querystring), making the field name match the pseudo-header, as is the case with the other entries in `ngx_http_proxy_wasm_dispatch_s`. --- src/http/proxy_wasm/ngx_http_proxy_wasm_dispatch.c | 10 +++++----- src/http/proxy_wasm/ngx_http_proxy_wasm_dispatch.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/http/proxy_wasm/ngx_http_proxy_wasm_dispatch.c b/src/http/proxy_wasm/ngx_http_proxy_wasm_dispatch.c index bfe15af25..f047819dc 100644 --- a/src/http/proxy_wasm/ngx_http_proxy_wasm_dispatch.c +++ b/src/http/proxy_wasm/ngx_http_proxy_wasm_dispatch.c @@ -258,8 +258,8 @@ ngx_http_proxy_wasm_dispatch(ngx_proxy_wasm_exec_t *pwexec, call->method.data = elt->value.data; } else if (ngx_str_eq(elt->key.data, elt->key.len, ":path", -1)) { - call->uri.len = elt->value.len; - call->uri.data = elt->value.data; + call->path.len = elt->value.len; + call->path.data = elt->value.data; } else if (ngx_str_eq(elt->key.data, elt->key.len, ":authority", -1)) @@ -330,7 +330,7 @@ ngx_http_proxy_wasm_dispatch(ngx_proxy_wasm_exec_t *pwexec, call->error = NGX_HTTP_PROXY_WASM_DISPATCH_ERR_BAD_METHOD; goto error; - } else if (!call->uri.len) { + } else if (!call->path.len) { call->error = NGX_HTTP_PROXY_WASM_DISPATCH_ERR_BAD_PATH; goto error; } @@ -577,7 +577,7 @@ ngx_http_proxy_wasm_dispatch_request(ngx_http_proxy_wasm_dispatch_t *call) * Connection: * Content-Length: */ - len += call->method.len + 1 + call->uri.len + 1 + len += call->method.len + 1 + call->path.len + 1 + sizeof(ngx_http_header_version11) - 1; len += sizeof(ngx_http_host_header) - 1 + sizeof(": ") - 1 @@ -638,7 +638,7 @@ ngx_http_proxy_wasm_dispatch_request(ngx_http_proxy_wasm_dispatch_t *call) b->last = ngx_cpymem(b->last, call->method.data, call->method.len); *b->last++ = ' '; - b->last = ngx_cpymem(b->last, call->uri.data, call->uri.len); + b->last = ngx_cpymem(b->last, call->path.data, call->path.len); *b->last++ = ' '; b->last = ngx_cpymem(b->last, ngx_http_header_version11, diff --git a/src/http/proxy_wasm/ngx_http_proxy_wasm_dispatch.h b/src/http/proxy_wasm/ngx_http_proxy_wasm_dispatch.h index a23e9a22e..97f5b99dd 100644 --- a/src/http/proxy_wasm/ngx_http_proxy_wasm_dispatch.h +++ b/src/http/proxy_wasm/ngx_http_proxy_wasm_dispatch.h @@ -40,7 +40,7 @@ struct ngx_http_proxy_wasm_dispatch_s { ngx_str_t host; ngx_str_t method; - ngx_str_t uri; + ngx_str_t path; /* ":path" (including query) */ ngx_str_t authority; ngx_array_t headers; ngx_array_t trailers;