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


##########
tests/gold_tests/pluginTest/slice/replay/slice_body_headers.replay.yaml:
##########
@@ -0,0 +1,90 @@
+#  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 slice strips duplicate body-declaring headers from 
block requests'
+
+  server:
+    name: 'server-body-headers'
+
+  client:
+    name: 'client-body-headers'
+
+  ats:
+    name: 'ts-body-headers'
+
+    records_config:
+      proxy.config.diags.debug.enabled: 1
+      proxy.config.diags.debug.tags: 'slice'
+      proxy.config.http.allow_half_open: 0
+      # A block request left waiting on a body fails quickly instead of 
hanging.
+      proxy.config.http.transaction_no_activity_timeout_in: 5
+
+    remap_config:
+      - from: "http://slice/";
+        to: "http://127.0.0.1:{SERVER_HTTP_PORT}/";
+        plugins:
+          - name: "slice.so"
+            args:
+              - "--blockbytes-test=11"
+
+# A client GET with repeated Transfer-Encoding fields must reach the origin
+# as a block request without any body-declaring header, otherwise the
+# internal transaction waits for a body slice never sends. The 8 byte body
+# fits in one 11 byte block, so there is exactly one block request.
+
+sessions:
+
+- transactions:
+
+  - client-request:
+      method: GET
+      url: /dup_te
+      version: '1.1'
+      headers:
+        fields:
+        - [Host, slice]
+        - [Transfer-Encoding, chunked]
+        - [Transfer-Encoding, chunked]
+        - [uuid, dup-te]
+      content:
+        size: 0
+
+    proxy-request:
+      headers:
+        fields:
+        - [Transfer-Encoding, {as: absent}]
+        - [Content-Length, {as: absent}]

Review Comment:
   The `Content-Length` absence check is currently vacuous because the client 
request never supplies that header, so removing line 99 in `client.cc` would 
not fail this regression test. Add a separate transaction with `Content-Length: 
0` and no `Transfer-Encoding`, then assert that the internal block request 
omits it. (ATS removes `Content-Length` during parsing when both headers are 
present.)



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