Repository navigation
Add HTTP QUERY method support (RFC 10008) - #5
Merged
Merged
Conversation
JakeChampion
force-pushed
the
claude/http-query-method-support-5v716q
branch
from
August 22, 2026 08:37
bf2dfd0 to
c2937ea
Compare
This was referenced Aug 22, 2026
JakeChampion
force-pushed
the
claude/cache-compat-fixes
branch
from
August 22, 2026 09:30
14cb4b8 to
9e54faa
Compare
JakeChampion
force-pushed
the
claude/http-query-method-support-5v716q
branch
from
August 22, 2026 09:30
c2937ea to
9e146eb
Compare
QUERY is a safe, idempotent method that carries request content, and its cache key must incorporate that content. Register it as a well known method and classify it as safe and idempotent so retry, invalidation and connection reuse treat it correctly. Expose it through the plugin API, the C++ API and Cripts, count it, and accept it in ip_allow.yaml method lists and @method= remap filters. Caching is opt-in via proxy.config.http.cache.query_method. When enabled the request content is buffered before the cache lookup and digested, with the method and the Content-Type, Content-Encoding and Content-Language values, into the cache key. Fields are length and count prefixed so distinct requests cannot produce the same digest. Values are digested byte for byte rather than normalized: RFC 10008 permits normalizing but warns that a false positive returns the wrong stored response, so a missed hit is preferred to a wrong hit. SHA-256 is used rather than CryptoContext, which is MD5 outside a FIPS build: every byte of this digest is supplied by the request, and constructing an MD5 collision is cheap. A QUERY whose content is chunked, absent, larger than proxy.config.http.cache.query_max_body_size, or larger than post_copy_size, bypasses the cache and is counted, rather than being keyed on part of its content, which would let two distinct queries collide. QUERY is appended after PUSH in the well known string table so that the indices of the existing methods, which are persisted in cached request headers, do not move. The header tokens after it do shift, so the cache minor version is bumped to have those recomputed on read. Co-Authored-By: Claude <[email protected]> Claude-Session: https://claude.ai/code/session_01Xp4ZMfVaT5EzvZsyMTx2y5
JakeChampion
force-pushed
the
claude/http-query-method-support-5v716q
branch
from
August 22, 2026 10:18
9e146eb to
f483171
Compare
JakeChampion
marked this pull request as ready for review
August 23, 2026 14:52
ebremer
added a commit
to ebremer/RFC10008support
that referenced
this pull request
Sep 4, 2026
The headline is Starlette. The ASGI layer under FastAPI merged QUERY at +75 -- the maintainer landed his own branch the day he opened it and closed both community PRs (+9 test client, +20 routing) in its favour. FastAPI pins starlette>=0.46.0, so the ASGI half of that story is done, and the discussion (+78) now puts the remaining gate on ReDoc 2 specifically rather than OpenAPI 3.2 generally: Swagger UI supports 3.2, ReDoc is gated on 3.1 and would not classify query as an operation. Django got a real PR. The contributor's fork became django/django#21855 at +74 and is drawing fellow review: QUERY content exposed through HttpRequest.body and deliberately not parsed, the same treatment as PUT, with the diff reaching admin, auth admin, the common/CSRF/conditional-GET middleware, utils.cache, the HTTP view decorators and the test client. The live question is scope -- whether cache/Vary support must land in the same PR or a follow-up ticket. Vapor is unblocked. swift-http-types 1.7.0 shipped at +79 with "Make QUERY method public" (#130), which was the exact condition the approved Vapor PR was held for. Nothing blocks it now; it simply has not been touched since +73. SwiftNIO's own PR is the last unmerged piece of the Swift stack. Status changes: fasthttp merged (+73), reitit merged (+76) after 69 days when a maintainer put it in mergeable shape himself, Hanami merged (+80). Next.js is out of draft but still unreviewed. Helidon changed shape -- after months where Oracle's contributor agreement was the blocker (the OCA download 404s outside the US), a maintainer said at +79 he will take the work over as a PR of his own with the contributor as co-author. Jakarta REST woke up after 62 days: a new contributor volunteered at +79 for the whole scope, annotation through TCK, though the underlying committer vote has not changed. nghttp2 closed not planned at +77 -- the stale bot, not a decision; nobody ever replied. oasdiff released in v1.30.0 (+75). GoFr took a second full review round at +78 and is the most actively reviewed open QUERY PR in the tracker. Non-events worth recording: Envoy's merge still has no release (1.40 not cut, latest v1.39.1 at +72), Spring has cut no milestone since M1 missed the merge, Slim 4.15.3 shipped at +77 without the 4.x backport even though the maintainer pushed the fix himself at +67, django-ninja 1.7.0 shipped at +75 without its PR, and Kong's discussion has now sat 46 days with zero comments. New rows (14). Servers: Grape (merged same-day at +78, the maintainer "excited to beat Rack and Rails on QUERY support", and correct, since Rails' merge is still unreleased), Wolverine, Tempest, APIFlask, Comunica (merged +77 -- the SPARQL engine many Solid apps sit on, moving before the protocol spec did), GenHTTP, Marko Run, Lilya. Clients: Kiota (the maintainer scoped it to adding QUERY to each language's HttpMethod enum, since arbitrary verbs would be source-breaking), Gleam http. Tooling: httpYac, hono-openapi, sphinxcontrib-httpdomain, W3C SPARQL Protocol (closed completed +77 -- not a first-class 1.2 binding, since 1.2 is scoped to RDF 1.2 and errata, but an informative Note mirroring the existing HTTP PATCH note). Also: Apache Traffic Server's row now names the fork carrying the work (JakeChampion/trafficserver#5, merged +69), since nothing has been proposed upstream; chi's row records that v5.3.1 was tagged the day after the merge, the fastest request-to-release turnaround here; HTTP::Message shipped in v7.04 the same day it merged; and Apache HttpClient's alpha1 date is corrected from +52 (the RC3 tag) to +58 (rel/v5.7-alpha1). All 120 changed star counts refreshed as of 2026-09-04. Every tracked issue and PR was re-checked against its live state, and release claims were checked against tags and changelogs rather than inferred from merge dates.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Draft. Adds support for the HTTP
QUERYmethod (RFC 10008, Standards Track, June 2026).This was the last of a four-PR stack. #6, #7 and #8 are now merged into
10.2.x, so this is rebased onto it and the diff is the QUERY work alone.QUERYis a safe, idempotent method that carries request content. The load-bearing requirement is §2.7: the cache key MUST incorporate the request content and its related metadata. That means the content has to be read and digested before the cache lookup, which is the only structurally interesting part of this change — the rest is table work.What is here
Method registration.
QUERYis a well-known method, classified safe and idempotent. Exposed asTS_HTTP_METHOD_QUERY/TS_HTTP_LEN_QUERY,atscppapi::HTTP_METHOD_QUERYandcripts::Method::QUERY, counted byproxy.process.http.query_requests, usable inip_allow.yamlmethods:lists and@method=remap filters, and advertised inAllow.Caching, opt-in via
proxy.config.http.cache.query_method, mirroringcache.post_method. RFC 10008 makes reuse a MAY rather than a SHOULD, and enabling it makes every QUERY buffer its content.The cache key. The buffered content is digested with the method and the
Content-Type,Content-EncodingandContent-Languagevalues, then folded into the URL-derived key. Three deliberate decisions:"ab"with type"c"collides with content"a"and type"bc". Without the counts, an absent field is indistinguishable from a present-but-empty one, and only the first value of a repeated field would count.CryptoContext, which is MD5 outside FIPS builds. Every byte of this digest is request-supplied and MD5 collisions are constructible, so two chosen bodies could be made to share a cache entry. (Deliberately notSHA256Context::finalize(CryptoHash &), which writes 32 bytes into a union that is only 16 outside a FIPS build.)Bypass rather than truncate. A QUERY bypasses the cache entirely — counted, never truncated — when its content is chunked, absent, or larger than the buffering limit. That limit is the lesser of
cache.query_max_body_sizeandpost_copy_size; ATS warns at startup if they disagree. Because HTTP/2 and HTTP/3 clients commonly omitcontent-length, QUERY caching in practice applies to requests arriving with an explicitContent-Length. All documented.HTTP/2. QUERY joins
content_method, so a QUERY carrying content is not sent with a prematureEND_STREAM.303 redirect handling
RFC 9110 §15.4.4 says a
303is followed with a GET carrying no content; ATS replayed the original method and content for every redirect status alike.proxy.config.http.redirect.see_other_as_get, defaulting to conformant. Redirect following is itself off by default, so the deployments affected are those that enabled it and rely on the method being replayed.Worth knowing: replaying request content across a redirect does not currently work at all — the followed request goes out with the original
Content-Lengthand no body behind it. That predates this change and is untouched here; the test for the setting-off case therefore uses a POST with no content, and says so.The one thing worth reviewing closely
QUERYis appended afterPUSHin the well-known string table rather than inserted in the natural place. Method indices are persisted verbatim in cached request headers and never recomputed, so inserting would silently misinterpret the method of every already-cached object. Appending keeps every existing index fixed; a unit test pins each offset so a future alphabetical insert fails loudly.The header tokens after the method block do shift, and those indices are persisted too — hence
CACHE_DB_MINOR_VERSION2 → 3, which makes older objects run throughrecompute_accelerators_and_presence_bits()on read. That bump is only safe because of the compatibility fixes in #8 (now merged), which pinned theHTTPInfocompat check to the version it actually describes and fixed the compressed-RAM-cache path that skipped the recompute.No cache clear is needed. Rolling back to a stock 10.2.x binary will treat objects written by this one as corrupt, since it rejects future versions.
Tests
Unit tests for method registration (including index-stability and contiguity invariants), the classification predicates, and the digest — checking every adjacent field pair for the concatenation ambiguity the length prefixes prevent, and that content shorter or longer than its declared
Content-Lengthis never keyed.AuTests for caching enabled and disabled, content-varied and
Content-Type-varied keys producing distinct entries, both directions of cross-method contamination, the oversize bypass,ip_allow/remap ACL filters, and the three 303 cases. The content-in-the-key tests were mutation-tested: withapply_query_cache_key()disabled they fail, so they are not passing vacuously.Defects found and fixed during review
Two review passes over the diff turned up more than the feature work did:
is_this_http_method_supported()did not know QUERY, socheck_request_validity()forced tunnelling mode andcache.query_methodhad no effect whatsoever.post_copy_size(default 2048), so with caching on, any QUERY body over 2 KB failed the transaction as403 Access Denied.Expect: 100-continuedeadlocked a buffered QUERY: the client waits for a 100 only the origin can send, and the origin is not contacted until the content is read.read_avail(). Replaced with a real cross-check againstContent-Length.client_responsedoes not survive the redirect rewrite, so the status must be read before it, not after.Known limitations, documented
Content-Locationis not digested. Missed hits only, never a wrong hit.