Skip to content
This repository was archived by the owner on Mar 1, 2023. It is now read-only.

Commit 176e190

Browse files
author
Gregor Noczinski
committed
#24 Skip intercepting of websocket requests.
1 parent 537486d commit 176e190

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

filter.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ type filterHandler struct {
1717
}
1818

1919
func (instance filterHandler) ServeHTTP(writer http.ResponseWriter, request *http.Request) (int, error) {
20+
// Do not intercept if this is a websocket upgrade request.
21+
if request.Method == "GET" && request.Header.Get("Upgrade") == "websocket" {
22+
return instance.next.ServeHTTP(writer, request)
23+
}
24+
2025
wrapper := newResponseWriterWrapperFor(writer, func(wrapper *responseWriterWrapper) bool {
2126
header := wrapper.Header()
2227
for _, rule := range instance.rules {

0 commit comments

Comments
 (0)