@@ -191,8 +191,9 @@ func TestHTTPInterceptor(t *testing.T) {
191191 assert .Equal (t , "dGhlIHNhbXBsZSBub25jZQ==" , headers .Get ("Sec-WebSocket-Key" ))
192192 assert .Equal (t , "13" , headers .Get ("Sec-WebSocket-Version" ))
193193
194- // Verify hop-by-hop headers are removed
195- assert .Empty (t , headers .Get ("Keep-Alive" ))
194+ // Verify only proxy-specific headers are removed
195+ // Keep-Alive should be preserved for proper HTTP semantics
196+ assert .Equal (t , "timeout=5" , headers .Get ("Keep-Alive" ))
196197 assert .Empty (t , headers .Get ("Proxy-Authorization" ))
197198 })
198199
@@ -210,7 +211,8 @@ func TestHTTPInterceptor(t *testing.T) {
210211 // Verify non-WebSocket upgrade headers are removed
211212 assert .Empty (t , headers .Get ("Upgrade" ))
212213 assert .Empty (t , headers .Get ("Connection" ))
213- assert .Empty (t , headers .Get ("Keep-Alive" ))
214+ // Keep-Alive should be preserved per RFC 7230
215+ assert .Equal (t , "timeout=5" , headers .Get ("Keep-Alive" ))
214216
215217 // Verify regular headers are preserved
216218 assert .Equal (t , "example.com" , headers .Get ("Host" ))
0 commit comments