Copilot commented on code in PR #13820:
URL: https://github.com/apache/trafficserver/pull/13820#discussion_r4249835093


##########
doc/release-notes/whats-new.en.rst:
##########
@@ -107,6 +108,12 @@ Features
 * Add an optional ``avg_obj_size`` to ``storage.yaml`` to control the directory
   entry sizing.
 * The ``proxy.config.http.cache.post_method`` is now an overridable config.
+* The HTTP ``QUERY`` method
+  (`draft-ietf-httpbis-safe-method-w-body 
<https://datatracker.ietf.org/doc/draft-ietf-httpbis-safe-method-w-body/>`_)
+  is now a well-known method. It can be named in :file:`ip_allow.yaml` and
+  :file:`remap.config` ACLs, it is reported by
+  ``proxy.process.http.query_requests``, and like the other content-carrying
+  methods it requires a ``Content-Length`` or chunked framing.

Review Comment:
   “chunked framing” is HTTP/1.1-specific and can be ambiguous (e.g., vs HTTP/2 
framing). Consider clarifying this as an HTTP/1.1 requirement and/or wording it 
as “`Content-Length` or `Transfer-Encoding: chunked`” to match protocol 
terminology.



##########
tests/gold_tests/query/replay/query-pass-through.replay.yaml:
##########
@@ -0,0 +1,130 @@
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+
+meta:
+  version: "1.0"
+
+autest:
+  description: 'Verify QUERY requests are proxied with their content'
+
+  server:
+    name: 'server'
+
+  client:
+    name: 'client'
+
+  ats:
+    name: 'ts'
+    process_config:
+      enable_cache: true
+    records_config:
+      proxy.config.diags.debug.enabled: 1
+      proxy.config.diags.debug.tags: 'http_trans|http_cache'
+    remap_config:
+      - from: "http://example.com/";
+        to: "http://127.0.0.1:{SERVER_HTTP_PORT}/";
+    metric_checks:
+      - metric: 'proxy.process.http.query_requests'
+        value: 3
+
+sessions:
+- transactions:
+
+  # A QUERY with content is forwarded to the origin, content and all.
+  - client-request:
+      method: QUERY
+      url: /search
+      version: '1.1'
+      headers:
+        fields:
+        - [Host, example.com]
+        - [Content-Type, application/sql]
+        - [Content-Length, "23"]
+        - [uuid, query-first]
+      content:
+        data: "SELECT * FROM t WHERE a"
+
+    proxy-request:
+      method: QUERY
+      headers:
+        fields:
+        - [Content-Length, {value: "23", as: equal}]
+      content:
+        verify: {value: "SELECT * FROM t WHERE a", as: equal}
+
+    server-response:
+      status: 200
+      reason: OK
+      headers:
+        fields:
+        - [Content-Length, "8"]
+        - [Cache-Control, "max-age=300"]
+      content:
+        data: "result-1"
+
+    proxy-response:
+      status: 200
+
+  # Caching of QUERY is off by default, so the identical request goes to the
+  # origin again rather than being served from cache.

Review Comment:
   This comment can read as if caching is globally disabled, but this test 
enables cache (`enable_cache: true`). Consider clarifying that it’s 
specifically `QUERY` response caching that’s off by default (e.g., “Caching of 
QUERY responses is off by default…”), to better align with the test setup and 
the PR description.



-- 
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