Skip to content

Commit 3ec7549

Browse files
committed
Support forwarding of websockets
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
1 parent 1be06a7 commit 3ec7549

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

executor/http_runner.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ func (f *HTTPFunctionRunner) Run(req FunctionRequest, contentLength int64, r *ht
132132
}
133133
defer cancel()
134134

135-
if strings.HasPrefix(r.Header.Get("Accept"), "text/event-stream") {
135+
if strings.HasPrefix(r.Header.Get("Accept"), "text/event-stream") ||
136+
r.Header.Get("Upgrade") == "websocket" {
136137
ww := fhttputil.NewHttpWriteInterceptor(w)
137138

138139
f.ReverseProxy.ServeHTTP(w, r)

0 commit comments

Comments
 (0)