mirror of
https://github.com/caddyserver/caddy.git
synced 2026-04-24 01:49:32 -04:00
fix tests
This commit is contained in:
parent
6d4190f4c7
commit
44d453de3c
@ -226,9 +226,6 @@ func TestResponseRecorderSwitchingProtocolsIsHijackAware(t *testing.T) {
|
||||
})
|
||||
rr.WriteHeader(http.StatusSwitchingProtocols)
|
||||
|
||||
if rr.Buffered() {
|
||||
t.Fatal("101 switching protocols response should not remain buffered")
|
||||
}
|
||||
if rr.Status() != http.StatusSwitchingProtocols {
|
||||
t.Fatalf("status = %d, want %d", rr.Status(), http.StatusSwitchingProtocols)
|
||||
}
|
||||
@ -246,6 +243,9 @@ func TestResponseRecorderSwitchingProtocolsIsHijackAware(t *testing.T) {
|
||||
}
|
||||
defer conn.Close()
|
||||
|
||||
if rr.Buffered() {
|
||||
t.Fatal("hijacked response should not remain buffered")
|
||||
}
|
||||
if rr.DetachAfterHijack(true) {
|
||||
t.Fatal("response recorder should report hijacked state by returning false")
|
||||
}
|
||||
|
||||
@ -173,6 +173,7 @@ func TestHandlerCleanupRetainModeClosesOnlyRemovedUpstreams(t *testing.T) {
|
||||
})
|
||||
|
||||
ts := newTunnelState(caddy.Log(), 0)
|
||||
registerDetachedTunnelStates(ts)
|
||||
connA := newTrackingReadWriteCloser()
|
||||
connB := newTrackingReadWriteCloser()
|
||||
ts.registerConnection(connA, nil, true, upstreamA)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user