Skip to content

Commit

Permalink
refactor(proxy-wasm) rename call->uri to call->path
Browse files Browse the repository at this point in the history
...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`.
  • Loading branch information
hishamhm committed Nov 21, 2024
1 parent 0bacf51 commit fd0fdcc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/http/proxy_wasm/ngx_http_proxy_wasm_dispatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/http/proxy_wasm/ngx_http_proxy_wasm_dispatch.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit fd0fdcc

Please sign in to comment.