From e2072399ddc2fff88c5980d3ff72579ce130d9c9 Mon Sep 17 00:00:00 2001 From: ginuerzh Date: Thu, 4 Sep 2025 21:30:49 +0800 Subject: [PATCH] fix sniffing for websocket --- internal/util/forwarder/sniffer.go | 2 +- internal/util/sniffing/sniffer.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/util/forwarder/sniffer.go b/internal/util/forwarder/sniffer.go index 0d77c1e5..86235d48 100644 --- a/internal/util/forwarder/sniffer.go +++ b/internal/util/forwarder/sniffer.go @@ -506,7 +506,7 @@ func (h *Sniffer) httpRoundTrip(ctx context.Context, rw, cc io.ReadWriteCloser, res.Write(rw) return } - if resp.StatusCode >= http.StatusContinue && resp.StatusCode < http.StatusOK { + if resp.StatusCode == http.StatusContinue { resp.Write(rw) resp.Body.Close() continue diff --git a/internal/util/sniffing/sniffer.go b/internal/util/sniffing/sniffer.go index 3893c824..7b42e0df 100644 --- a/internal/util/sniffing/sniffer.go +++ b/internal/util/sniffing/sniffer.go @@ -360,7 +360,7 @@ func (h *Sniffer) httpRoundTrip(ctx context.Context, rw, cc io.ReadWriteCloser, err = fmt.Errorf("read response: %v", err) return } - if resp.StatusCode >= http.StatusContinue && resp.StatusCode < http.StatusOK { + if resp.StatusCode == http.StatusContinue { resp.Write(rw) resp.Body.Close() continue