Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP: Add support for QUERY method #2007

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/client_side_request.cc
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@ clientInterpretRequestHeaders(ClientHttpRequest * http)
}

/* ignore range header in non-GETs or non-HEADs */
if (request->method == Http::METHOD_GET || request->method == Http::METHOD_HEAD) {
if (request->method == Http::METHOD_GET || request->method == Http::METHOD_HEAD || request->method == Http::METHOD_QUERY) {
// XXX: initialize if we got here without HttpRequest::parseHeader()
if (!request->range)
request->range = req_hdr->getRange();
Expand All @@ -943,7 +943,7 @@ clientInterpretRequestHeaders(ClientHttpRequest * http)
}
}

/* Only HEAD and GET requests permit a Range or Request-Range header.
/* Only HEAD, GET, and QUERY requests permit a Range or Request-Range header.
* If these headers appear on any other type of request, delete them now.
*/
else {
Expand Down
3 changes: 3 additions & 0 deletions src/http/MethodType.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ typedef enum _method_t {
// RFC 9113
METHOD_PRI,

// draft-ietf-httpbis-safe-method-w-body
METHOD_QUERY,

// Squid extension methods
METHOD_PURGE,
METHOD_OTHER,
Expand Down
1 change: 1 addition & 0 deletions src/http/RegisteredHeaders.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ enum HdrType {
ACCEPT_ENCODING, /**< RFC 7231 */
/*ACCEPT_FEATURES,*/ /* RFC 2295 */
ACCEPT_LANGUAGE, /**< RFC 7231 */
ACCEPT_QUERY, /**< draft-ietf-httpbis-safe-method-w-body */
ACCEPT_RANGES, /**< RFC 7233 */
AGE, /**< RFC 9111 */
ALLOW, /**< RFC 7231 */
Expand Down
Loading