Let URL's host take precedence
License: MIT Signed-off-by: Hector Sanjuan <hector@protocol.ai>
Hector Sanjuan committed
Oct 5, 2018 at 02:39 UTC
2cc1a995664407a075b6c33aeea081a53da5370a
1 file changed
+1
core/corehttp/proxy.go
+1
@@ -25,6 +25,7 @@ func ProxyOption() ServeOption {
25
return
26
}
27
28
+ request.Host = "" // Let URL's Host take precedence.
29
target, err := url.Parse(fmt.Sprintf("libp2p://%s/%s", parsedRequest.target, parsedRequest.httpPath))
30
if err != nil {
31
handleError(w, "Failed to parse url", err, 400)