This is an automated email from the ASF dual-hosted git repository.

bneradt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 6b84d6d9fb Fix TS_HTTP_REQUEST_TRANSFORM_HOOK Tunnel Processing (#9724)
6b84d6d9fb is described below

commit 6b84d6d9fb97c1ccfd343db07af99c3f9f36d6fc
Author: Brian Neradt <brian.ner...@gmail.com>
AuthorDate: Mon May 22 17:16:47 2023 -0500

    Fix TS_HTTP_REQUEST_TRANSFORM_HOOK Tunnel Processing (#9724)
    
    This fixes a bug in client request processing for transform tunnels.
    Without this fix, the transform request tunnel was not created for
    requests with a body which made it so that request transform plugins
    were not dispatched to for the various events concerning requests with a
    body.
---
 proxy/http/HttpSM.cc                                        | 4 ++--
 tests/gold_tests/pluginTest/multiplexer/multiplexer.test.py | 8 +++++++-
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc
index db602d0de1..a34d8ad869 100644
--- a/proxy/http/HttpSM.cc
+++ b/proxy/http/HttpSM.cc
@@ -6054,8 +6054,8 @@ HttpSM::handle_http_server_open()
 
     int method = t_state.hdr_info.server_request.method_get_wksidx();
     if (method != HTTP_WKSIDX_TRACE &&
-        server_txn->has_request_body(t_state.hdr_info.response_content_length,
-                                     t_state.server_info.transfer_encoding == 
HttpTransact::CHUNKED_ENCODING) &&
+        server_txn->has_request_body(t_state.hdr_info.request_content_length,
+                                     t_state.client_info.transfer_encoding == 
HttpTransact::CHUNKED_ENCODING) &&
         do_post_transform_open()) {
       do_setup_post_tunnel(HTTP_TRANSFORM_VC); /* This doesn't seem quite 
right.  Should be sending the request header */
     } else {
diff --git a/tests/gold_tests/pluginTest/multiplexer/multiplexer.test.py 
b/tests/gold_tests/pluginTest/multiplexer/multiplexer.test.py
index da75733fda..8ab537c5fb 100644
--- a/tests/gold_tests/pluginTest/multiplexer/multiplexer.test.py
+++ b/tests/gold_tests/pluginTest/multiplexer/multiplexer.test.py
@@ -113,7 +113,7 @@ class MultiplexerTestBase:
             "proxy.config.ssl.client.verify.server.policy": 'PERMISSIVE',
 
             'proxy.config.diags.debug.enabled': 1,
-            'proxy.config.diags.debug.tags': 'multiplexer',
+            'proxy.config.diags.debug.tags': 'http|multiplexer',
         })
         self.ts.Disk.ssl_multicert_config.AddLine(
             'dest_ip=* ssl_cert_name=server.pem ssl_key_name=server.key'
@@ -172,6 +172,12 @@ class MultiplexerTest(MultiplexerTestBase):
         self.server_https.Streams.All += Testers.ContainsExpression(
             'uuid: POST',
             "Verify the HTTPS server received the POST request.")
+        self.server_http.Streams.All += Testers.ContainsExpression(
+            'x-response: second',
+            "Verify the HTTP server sent the POST response.")
+        self.server_https.Streams.All += Testers.ContainsExpression(
+            'x-response: second',
+            "Verify the HTTPS server sent the POST response.")
 
         # Same with PUT
         self.server_http.Streams.All += Testers.ContainsExpression(

Reply via email to