Repository navigation
HTTP: added QUERY method support. - #1488
NicoAvanzDev wants to merge 1 commit into
Conversation
|
✅ All required contributors have signed the F5 CLA for this PR. Thank you! |
There was a problem hiding this comment.
Pull request overview
This pull request adds first-class support for the HTTP QUERY method across nginx’s HTTP/1.x, HTTP/2, and HTTP/3 request parsing, and wires it into method-based configuration features (notably limit_except and proxy_cache_methods) so it can be selected/controlled like other known methods.
Changes:
- Introduces a new internal method bitmask/identifier (
NGX_HTTP_QUERY). - Recognizes
QUERYin the HTTP/1.x request line parser and in HTTP/2/HTTP/3 pseudo-header method parsing. - Allows
QUERYto be used bylimit_exceptand in upstream proxy caching method masks.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/http/v3/ngx_http_v3_request.c | Adds QUERY to the HTTP/3 :method name→ID lookup table. |
| src/http/v2/ngx_http_v2.c | Adds QUERY to the HTTP/2 :method parsing lookup table. |
| src/http/ngx_http_upstream.c | Extends proxy_cache_methods bitmask options to include QUERY. |
| src/http/ngx_http_request.h | Defines the new NGX_HTTP_QUERY method bitmask constant. |
| src/http/ngx_http_parse.c | Recognizes QUERY in HTTP/1.x request line parsing (5-char method case). |
| src/http/ngx_http_core_module.c | Enables QUERY in limit_except method name mapping. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
I have hereby read the F5 CLA and agree to its terms |
77ad3c5 to
eb60d10
Compare
|
Hi, Heh, so this is pretty new, like hot out the oven! It's perhaps worth noting in the commit message that this is newly It's perhaps also worth pointing out that this doesn't (or so I So this is really just an initial basic implementation. Which might be But there may be other considerations to make. |
Hi, Thanks for the feedback. I agree, I’ll update the commit message to mention that QUERY is a newly introduced HTTP method and include a reference to RFC 10008. Regarding caching, you’re right: this patch only adds basic method recognition/handling and does not attempt to include the request body in the cache key for cases such as proxy_cache_methods QUERY. I’d prefer to keep this initial patch limited in scope, and handle cache-related behavior separately if that is considered useful. Thanks! |
The QUERY method is defined by RFC 10008. Added a method identifier for QUERY and recognized it in HTTP/1.x, HTTP/2, and HTTP/3 request parsing. QUERY can now be used in limit_except and proxy_cache_methods. This is an initial implementation for method recognition and method-based configuration. It does not add special handling for QUERY request content, nor does it include the request body in the proxy cache key.HTTP: added QUERY method support. Recognize the QUERY method in HTTP/1.x, HTTP/2, and HTTP/3. Allow QUERY in limit_except and proxy_cache_methods directives.
eb60d10 to
dec500f
Compare
Problem
RFC 10008 defines the HTTP QUERY method. nginx does not currently recognize
QUERY as a known HTTP method.
As a result, QUERY cannot be selected in
limit_exceptor enabled inproxy_cache_methods, and HTTP/2 and HTTP/3 requests do not receive adedicated method identifier.
Solution
Add a method identifier for QUERY and recognize it in the HTTP/1.x, HTTP/2,
and HTTP/3 request parsers. Also allow QUERY in
limit_exceptandproxy_cache_methods.This is an initial implementation for method recognition and method-based
configuration. It does not add special handling for QUERY request content, and
does not include the request body in the proxy cache key for configurations such
as
proxy_cache_methods QUERY. Cache-key behavior for QUERY can be consideredseparately if needed.
Testing
Built nginx with HTTP/2 and HTTP/3 enabled and ran the QUERY method tests for
HTTP/1.x, HTTP/2, HTTP/3,
limit_except, proxy forwarding, and proxy caching.All 232 checks pass.
Checklist
Release Notes
nginx recognizes the HTTP QUERY method over HTTP/1.x, HTTP/2, and HTTP/3, and
supports it in method-based access and proxy cache configuration.