JakeChampion opened a new pull request, #14028:
URL: https://github.com/apache/trafficserver/pull/14028

   This PR replaces #13820. It contains the same change, rebased on `master`, 
from a branch in this repository.
   
   The HTTP `QUERY` method 
([draft-ietf-httpbis-safe-method-w-body](https://datatracker.ietf.org/doc/draft-ietf-httpbis-safe-method-w-body/))
 is an extension method in ATS at this time. Thus:
   
   - ATS tunnels it and does not process it like the other standard methods.
   - You cannot name it in `ip_allow.yaml` or `remap.config` ACLs.
   - The per-method request stats do not count it.
   
   This change adds `QUERY` to the well-known token table. It also gives 
`QUERY` the semantics that the draft defines: it is **safe**, **idempotent**, 
and it **carries request content**. Thus an HTTP/1.1 `QUERY` must have a 
`Content-Length` or `Transfer-Encoding: chunked`, as `POST` and `PUT` must.
   
   `QUERY` comes after `PUSH` in the method block. Thus the values of the 
`HTTP_WKSIDX_*` constants do not change, and the `ip_allow` method bitmask does 
not change.
   
   ### Retry behavior
   
   `GET` and `HEAD` can retry after ATS sent bytes to the origin. `QUERY` does 
not use this path, because ATS does not keep its content for replay on that 
path. After ATS sends a part of the request, ATS processes a `QUERY` like a 
`POST`. If an HTTP/2 origin reports that it did not process the request, ATS 
can retry a buffered `QUERY`.
   
   ### OPTIONS `Allow` value
   
   `QUERY` makes the `Allow` value of an `OPTIONS` response longer. This showed 
a bug: the code appended the value with the `string_view` overload and a `char 
*` with no length. Thus `strlen` measured a buffer with no terminator, and the 
value can get unwanted bytes at the end. The code now gives the length.
   
   ### Tests
   
   The new Uranium tests are in `tests/uranium_tests/query/`:
   
   - `query-pass-through.test.yaml`: ATS sends a `QUERY` and its content to the 
origin, does not cache the response, and rejects a `QUERY` with no length with 
a 411.
   - `query-ip-allow.test.yaml` and `query-remap-acl.test.yaml`: ACLs can deny 
`QUERY` and continue to allow `GET`.
   - `test_query_retry.py`: ATS does not retry a `QUERY` after the origin 
closes the connection. This is true when 
`proxy.config.http.request_buffer_enabled` is 1 and when it is 0. A `GET` is 
the control case and ATS retries it.
   
   ### Not in this PR
   
   A cache for `QUERY` responses will come in a different PR, because the cache 
key must include the request body.
   
   The plugin API and logstats changes will come in separate PRs. If you want 
them in this PR, tell me.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to