From b2f70568bfffb042d7afa79263390b7fac1ba644 Mon Sep 17 00:00:00 2001 From: Michael Li Date: Wed, 8 Jan 2025 14:33:33 -0500 Subject: [PATCH] CR --- .../e2e/tests/base/target_tcp_connect_http_test.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/testing/internal/e2e/tests/base/target_tcp_connect_http_test.go b/testing/internal/e2e/tests/base/target_tcp_connect_http_test.go index 43f2237703..7c43c427ef 100644 --- a/testing/internal/e2e/tests/base/target_tcp_connect_http_test.go +++ b/testing/internal/e2e/tests/base/target_tcp_connect_http_test.go @@ -65,13 +65,18 @@ func TestCliTcpTargetConnectHttp(t *testing.T) { }) t.Log("Starting a webserver on the target...") - htmlPage := "Hello World!" + htmlPage := `HTTP/1.1 200 OK +Content-Type: text/html; charset=UTF-8 +Server: netcat-can-you-believe-it + +Hello World! +` go func() { _, err = f.Write([]byte(fmt.Sprintf("echo '%s' > somepage.html\n", htmlPage))) require.NoError(t, err) _, err = f.Write([]byte(fmt.Sprintf("while true; do nc -l -p %s -q 1 < somepage.html; done\n", destPort))) require.NoError(t, err) - _, _ = io.Copy(io.Discard, f) // Not checking error here since it fails in CI for some reason + _, _ = io.Copy(io.Discard, f) // Not checking error here since it will return an error on session close }() s := boundary.WaitForSessionCli(t, ctx, projectId) @@ -85,10 +90,8 @@ func TestCliTcpTargetConnectHttp(t *testing.T) { "connect", "http", "-target-id", httpTargetId, "-scheme", "http", - "--", - "--http0.9", ), ) require.NoError(t, output.Err, string(output.Stderr)) - require.Contains(t, string(output.Stdout), htmlPage) + require.Contains(t, string(output.Stdout), "Hello World!") }