feat(cache): allow HTTP QUERY method in Cache API boundary#6857
Open
Utsav7428 wants to merge 1 commit into
Open
feat(cache): allow HTTP QUERY method in Cache API boundary#6857Utsav7428 wants to merge 1 commit into
Utsav7428 wants to merge 1 commit into
Conversation
Signed-off-by: Utsav7428 <utsav73629@gmail.com>
|
All contributors have signed the CLA ✍️ ✅ |
Author
|
I have read the CLA Document and I hereby sign the CLA |
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.
What does this PR do?
This PR implements Phase 1 and Phase 2 of supporting the HTTP
QUERYmethod (RFC 10008) in the Cache API boundary.Previously,
Cache::match,put, anddelete_strictly enforcedkj::HttpMethod::GETviaJSG_REQUIREand hardcoded validation blocks, resulting in aTypeErrorat the JavaScript boundary.Changes included in this PR:
src/workerd/api/cache.c++to acceptkj::HttpMethod::QUERYalongsideGET.Cache::matchto dynamically extract theContent-Lengthheader forQUERYrequests and pass it to the underlyinghttpClient->request, rather than hardcoding a0byte body.QUERYand updated thetail:testtelemetry expectations to account for the 3 new cache operation spans (cache_put,cache_match,cache_delete).Architectural Context
This PR establishes the baseline routing for
QUERY. It is fully tested and ready for review. The actual body-stream pumping (Phase 3) will be handled in a separate follow-up PR to keep this review focused and isolated. I am opening this as a Draft to invite feedback on this architectural approach.Testing
cache-testsuite passes.tail:test) updated and passing.Content-Lengthlocally.