shinrich commented on code in PR #10861:
URL: https://github.com/apache/trafficserver/pull/10861#discussion_r1410898676


##########
tests/gold_tests/bad_http_fmt/bad_http_fmt.test.py:
##########
@@ -55,108 +101,111 @@
     '      - GET'
 ])
 
-Test.GetTcpPort("server_port")
-
-
-def server_cmd(resp_id):
-    dq = '"'
-    return (fr"(nc -o server{resp_id}.log " +
-            fr"--sh-exec 'sleep 1 ; printf {dq}HTTP/1.1 200 OK\r\n" +
-            fr"X-Resp-Id: {resp_id}\r\n" +
-            fr"Content-Length: 0\r\n\r\n{dq}' " +
-            fr"-l 127.0.0.1 {Test.Variables.server_port} & )")
-
+ts.Disk.remap_config.AddLine(
+    'map /add-method 
http://127.0.0.1:{0}/'.format(Test.Variables.upstream_port)
+)
+ts.Disk.remap_config.AddLine(
+    'map / http://127.0.0.1:{0}/'.format(server.Variables.Port)
+)
 
 # Even if the request from the client is HTTP version 1.0, ATS's request to 
server will be HTTP version 1.1.
 #
-tr = Test.AddTestRun()
+tr = Test.AddTestRun("success-1.0")
 tr.Processes.Default.StartBefore(ts)
+tr.Processes.Default.StartBefore(server)
 tr.Processes.Default.Command = (
-    server_cmd(1) +
-    fr" ; printf 'GET {random_path}HTTP/1.0\r\n" +
-    fr"Host: localhost:{Test.Variables.server_port}\r\n" +
-    r"X-Req-Id: 0\r\n\r\n'" +
+    f"printf 'GET {random_path}/0 HTTP/1.0\r\n" +

Review Comment:
   The original has these first two cases returning 200.  I went ahead and 
removed the space, and it still returns 200.  Evidently trafficserver pulls the 
HTTP/1.x from the end of the line and interprets the rest as the URL.



-- 
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: github-unsubscr...@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to