Skip to content

HTTP: added QUERY method support. - #1488

Open
NicoAvanzDev wants to merge 1 commit into
nginx:masterfrom
NicoAvanzDev:query-method-support
Open

NicoAvanzDev wants to merge 1 commit into
nginx:masterfrom
NicoAvanzDev:query-method-support

Conversation

@NicoAvanzDev

@NicoAvanzDev NicoAvanzDev commented Jun 22, 2026 •

Copy link
Copy Markdown

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_except or enabled in
proxy_cache_methods, and HTTP/2 and HTTP/3 requests do not receive a
dedicated 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_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, 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 considered
separately 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

  • I have read the CONTRIBUTING guidelines
  • I have added tests to validate my changes
  • All relevant tests pass
  • Documentation changes are not applicable
  • My branch is rebased on the latest master
  • This PR targets the master branch from my fork
  • My commit message follows NGINX standards

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.

@github-actions

github-actions Bot commented Jun 22, 2026 •

Copy link
Copy Markdown

✅ All required contributors have signed the F5 CLA for this PR. Thank you!
Posted by the CLA Assistant Lite bot.

@NicoAvanzDev
NicoAvanzDev marked this pull request as ready for review June 22, 2026 07:33
Copilot AI review requested due to automatic review settings June 22, 2026 07:33

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 QUERY in the HTTP/1.x request line parser and in HTTP/2/HTTP/3 pseudo-header method parsing.
  • Allows QUERY to be used by limit_except and 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.

Comment thread src/http/v2/ngx_http_v2.c Resolved
@NicoAvanzDev

Copy link
Copy Markdown
Author

I have hereby read the F5 CLA and agree to its terms

@NicoAvanzDev
NicoAvanzDev force-pushed the query-method-support branch from 77ad3c5 to eb60d10 Compare June 22, 2026 07:41
@ac000 ac000 self-assigned this Jun 23, 2026
@ac000
ac000 self-requested a review June 23, 2026 23:20
@ac000

ac000 commented Jun 24, 2026

Copy link
Copy Markdown
Member

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
introduced and providing a link to RFC 10008.

It's perhaps also worth pointing out that this doesn't (or so I
believe) handle caching the body along with the key. E.g. with
proxy_cache_methods QUERY

So this is really just an initial basic implementation. Which might be
good enough.

But there may be other considerations to make.

@NicoAvanzDev

NicoAvanzDev commented Jun 25, 2026 •

Copy link
Copy Markdown
Author

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 introduced and providing a link to RFC 10008.

It's perhaps also worth pointing out that this doesn't (or so I believe) handle caching the body along with the key. E.g. with proxy_cache_methods QUERY

So this is really just an initial basic implementation. Which might be good enough.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: External Pull Requests

Development

Successfully merging this pull request may close these issues.

4 participants