Skip to content

Commit cbdc924

Browse files
fabien-dlbantoniomika
authored andcommitted
Copy user agent header from incoming request to fix issue koding#33
1 parent 7ed82d8 commit cbdc924

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

websocketproxy.go

+3
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ func (w *WebsocketProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
8888
// Pass headers from the incoming request to the dialer to forward them to
8989
// the final destinations.
9090
requestHeader := http.Header{}
91+
if origin := req.Header.Get("User-Agent"); origin != "" {
92+
requestHeader.Add("User-Agent", origin)
93+
}
9194
if origin := req.Header.Get("Origin"); origin != "" {
9295
requestHeader.Add("Origin", origin)
9396
}

0 commit comments

Comments
 (0)