Repository navigation
Conversation
Motivation: HTTP QUERY skipped date revalidation, could silently supply a default media type for a missing declaration, and did not consistently handle Accept-Query Structured Field metadata. Modification: Use the selected QUERY result's validator for date revalidation and require a usable Content-Type before server entity construction. Parse Structured Field lists, combine repeated Accept-Query response fields, and reject media parameters that cannot be represented as Structured Fields. Result: An unchanged result can return a bodyless 304. Both HTTP versions enforce declaration presence, and both DSLs expose the complete advertised media list without changing public signatures. References: https://www.rfc-editor.org/rfc/rfc10008.html https://www.rfc-editor.org/rfc/rfc9651.html#section-4.2 apache#1077 apache#1858
c6f15b8 to
101e36d
Compare
101e36d to
7b250c2
Compare
|
Deep review of the updated PR (commit 7b250c2). Overall the design is sound and I found no blockers. Verified correct:
Left 6 inline comments (2 design, 1 test, 3 minor correctness/consistency) — all suggestions/nits, none blocking. Main themes: document the QUERY-vs-GET future-date divergence and the conditional -> range attribute ordering contract, and add an e2e HTTP/2 split Accept-Query test. |
7b250c2 to
ec37410
Compare
He-Pin
left a comment
There was a problem hiding this comment.
Overall LGTM — the RFC 10008 QUERY protocol handling, Accept-Query deferred parsing, conditional ordering, and opt-in withQueryRangeSupport look solid and all 6 CI checks pass. Left two minor non-blocking notes inline.
pjfanning
left a comment
There was a problem hiding this comment.
Thanks for this. Source review only, I have not run it. A few points:
conditional(CacheConditionDirectives): for QUERY a matchingIf-None-Match(or*with a selected representation) gives 412, whileIf-Modified-Sincegives 304. A client that revalidates a QUERY result by ETag can then never get a 304. The PR's own reference (RFC 10008 section 2.6 and appendix A.5) treats QUERY like GET for revalidation, so I would expect 304 for the ETag case too. I saw this is marked as intentional; could you say why?- The 400 for a QUERY request without
Content-Typeis not opt-in and changes behaviour for 2.0.x users. Our own client rendersHttpRequest(QUERY, uri)with an empty entity without aContent-Type, so it would now get a 400 from a Pekko HTTP server. This needs a release note under Behavior Changes, and I think the client side should either fail early or be documented. withQueryRangeSupport: therangeCountLimitcheck is insidemapRouteResultWithPF, so the inner route has already run when the request is rejected withTooManyRangesRejection. The GET path checks before running the route. Could QUERY do the same?- An invalid
Accept-Queryon a response is now dropped, where main keeps it as aRawHeader(and the trailer path still does). Is that intended? It is also one more scan of the headers for every client response. withQueryRangeSupport(Scala and both Java overloads) has no@since 2.1.0, no directive page oralphabetically.mdentry, and the JavalastModifiedIsStrongoverload has no test.- The new
requirein theAccept-Queryconstructor is not mentioned in the description.
Motivation: HTTP QUERY needs selected-result preconditions, structured format advertisements, and opt-in byte ranges beyond method registration. Modification: Validate QUERY content metadata and evaluate preconditions against the selected result. Model Accept-Query after collecting initial response fields, leaving trailers unchanged. Add opt-in QUERY range handling and apply the range count limit before selecting an entity strategy. Reject unrepresentable parameters when building typed Accept-Query values. Result: Default GET handling is unchanged. QUERY preserves the full otherwise successful response when If-Range has no matching strong validator. Tests: Exercise typed date and range routing, including streamed results, as well as a native HTTP/2 exchange with two Accept-Query field lines. Verify the Java strong Last-Modified overload with a matching date and check the new range guide and migration notes. References: RFC 10008 sections 2 and 3, RFC 9110 sections 13 and 14, RFC 9651 section 4.2.
ec37410 to
4c0b7d7
Compare
Motivation: A known representation must satisfy wildcard If-Match even when the route supplies only Last-Modified. Modification: Skip If-Unmodified-Since for that matched wildcard, while retaining later preconditions and tagged behavior. Result: A stale date alone still rejects PUT; the same request with a matching wildcard runs the route. References: RFC 9110 §§13.1.1, 13.1.4 and 13.2.2; apache#1858.
pjfanning
left a comment
There was a problem hiding this comment.
Thanks, the six points from my last review are addressed: the release notes cover the Content-Type 400 and the Accept-Query constructor checks, withQueryRangeSupport has @since, a directive page and a Java test for lastModifiedIsStrong, and the docs now explain the 412 for If-None-Match and the dropped invalid Accept-Query.
One new point. The appended commit (wildcard If-Match taking precedence over If-Unmodified-Since when only Last-Modified is supplied) changes conditional for PUT and other non-QUERY methods: a request that got 412 on main now runs the inner route. That is unrelated to QUERY and has no entry in releases-2.1.md. I would prefer it as its own PR; at the least it needs a Behavior Changes entry.
Motivation
RFC 10008 defines QUERY request metadata, preconditions on the selected result, structured format advertisements, and byte-range semantics. The existing method registration does not implement all of those behaviors.
Modification
conditional. Do not change the GET range directive.Result
Application code supplies the query decoder, selected representation metadata and any result URIs. An unverifiable
If-Rangeleaves an otherwise successful200intact. An applicable range request that exceeds the configured count is rejected even when the result length is unknown; within the limit, unknown-length results stay intact. Redirect following and cache eligibility are not enabled globally.Tests
Accept-Queryfield lines into one modeled header.References