Skip to content

Commit

Permalink
Copy user agent header from incoming request to fix issue koding#33
Browse files Browse the repository at this point in the history
  • Loading branch information
fabien-dlb authored and antoniomika committed May 14, 2020
1 parent 7ed82d8 commit cbdc924
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions websocketproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ func (w *WebsocketProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
// Pass headers from the incoming request to the dialer to forward them to
// the final destinations.
requestHeader := http.Header{}
if origin := req.Header.Get("User-Agent"); origin != "" {
requestHeader.Add("User-Agent", origin)
}
if origin := req.Header.Get("Origin"); origin != "" {
requestHeader.Add("Origin", origin)
}
Expand Down

0 comments on commit cbdc924

Please sign in to comment.