Skip to content

Commit 01c3345

Browse files
feat: Ensure system headers are preserved in streamable HTTP tests
To maintain consistency and ensure the integrity of HTTP headers during tests, system headers like Content-Type are now verified to be preserved. This change enhances the reliability of our testing framework by ensuring essential headers are not inadvertently removed or altered during the testing process. Signed-off-by: Matthis Holleville <[email protected]>
1 parent 99ccc6e commit 01c3345

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

client/transport/streamable_http_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,11 @@ func TestStreamableHTTP(t *testing.T) {
267267
if headerValues, ok := result["X-Test-Header"].([]any); !ok || len(headerValues) == 0 || headerValues[0] != "test-header-value" {
268268
t.Errorf("Expected X-Test-Header to be ['test-header-value'], got %v", result["X-Test-Header"])
269269
}
270+
271+
// Verify system headers are still present
272+
if contentType, ok := result["Content-Type"].([]any); !ok || len(contentType) == 0 {
273+
t.Errorf("Expected Content-Type header to be preserved")
274+
}
270275
})
271276

272277
t.Run("SendRequestWithTimeout", func(t *testing.T) {

0 commit comments

Comments
 (0)