From 609add32a0efc0004dcb4dc135bdf7d35680890c Mon Sep 17 00:00:00 2001 From: Ivan Krutov Date: Mon, 24 Jun 2019 15:03:13 +0300 Subject: [PATCH] Overriding Host header in devtools module --- selenium/chrome/devtools/devtools.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/selenium/chrome/devtools/devtools.go b/selenium/chrome/devtools/devtools.go index 68da3f097..11909438f 100644 --- a/selenium/chrome/devtools/devtools.go +++ b/selenium/chrome/devtools/devtools.go @@ -49,6 +49,7 @@ func proxyWebSocket(w http.ResponseWriter, r *http.Request, u *url.URL) { u.Scheme = "http" (&httputil.ReverseProxy{ Director: func(r *http.Request) { + r.Host = "localhost" r.URL = u }, }).ServeHTTP(w, r) @@ -78,6 +79,7 @@ func protocol(w http.ResponseWriter, r *http.Request) { log.Printf("[PROTOCOL] [%s]", u.String()) (&httputil.ReverseProxy{ Director: func(r *http.Request) { + r.Host = "localhost" r.URL = u }, }).ServeHTTP(w, r)