JakeChampion / JakeChampion/trafficserver

[audit][standards] HTTP QUERY method (draft-ietf-httpbis-safe-method-w-body) absent from well-known method table

Open
#37 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area:standards audit severity:medium
Dominant language
C++
Stars
0
Forks
0
Avg merge
8h 2m
Merged PRs (30d)
21

Description

Severity: medium · Category: missing-feature
Location: src/proxy/hdrs/HdrToken.cc:113

What's wrong

The static well-known method list contains only CONNECT, DELETE, GET, POST, HEAD, OPTIONS, PURGE, PUT, TRACE and the ATS-proprietary PUSH; QUERY is absent both here and in the HTTP_METHOD_/HTTP_WKSIDX_ initialization in src/proxy/hdrs/HTTP.cc:147-178. A QUERY request is therefore treated as an unknown method: it is proxied, but HttpTransactHeaders::is_method_cacheable and the GET-centric checks (e.g. src/proxy/http/HttpTransact.cc:3183, 6327) mean QUERY responses are never cached, defeating the primary purpose of the method (a safe, cacheable GET-with-body), and per-method stats/ACL matching cannot reference it. As QUERY approaches RFC status and origins/CDNs adopt it, ATS as a caching proxy will silently degrade to pass-through for that traffic.

Evidence
src/proxy/hdrs/HdrToken.cc:113:
  "CONNECT", "DELETE", "GET", "POST", "HEAD", "OPTIONS", "PURGE", "PUT", "TRACE", "PUSH",
// src/proxy/hdrs/HTTP.cc:147-156 initializes only these ten methods (no QUERY).
Suggested fix

Add QUERY to the hdrtoken static method tables and HTTP_WKSIDX_* set, and design cache-key semantics (key must incorporate a digest of the request content per the draft) before enabling caching for it; at minimum register the token so stats, ACLs, and plugins can match it.


Filed from an automated multi-lens codebase audit. Full report: CODEBASE_AUDIT.md / audit-report.html on branch claude/codebase-audit-review-9nw7vz.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/proxy/hdrs/HdrToken.cc:113 and the HTTP_WKSIDX_* initialization in src/proxy/hdrs/HTTP.cc:147-178 to trace how well-known methods are registered. Then inspect the cacheability checks in src/proxy/http/HttpTransact.cc:3183 and 6327, along with the draft's request-content cache-key requirements. Done should include a decided QUERY registration and cache-key behavior, with stats and ACL matching covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend-api-design, networking
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.