mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
Remove "Host:" prefix from Host header
That thould work with Go 1.4.3 according to sources inside Google.
This commit is contained in:
parent
dd2ab2820e
commit
13d14ab94d
1 changed files with 1 additions and 5 deletions
|
@ -116,11 +116,7 @@ func getTestServer(handler func(w http.ResponseWriter, r *http.Request)) (*httpt
|
||||||
testServer := httptest.NewServer(http.HandlerFunc(handler))
|
testServer := httptest.NewServer(http.HandlerFunc(handler))
|
||||||
client := &http.Client{
|
client := &http.Client{
|
||||||
Transport: &http.Transport{Proxy: func(r *http.Request) (*url.URL, error) {
|
Transport: &http.Transport{Proxy: func(r *http.Request) (*url.URL, error) {
|
||||||
|
r.Host = "gohugo.io"
|
||||||
if !strings.Contains(runtime.Version(), "go1.4") {
|
|
||||||
r.Host = "Host: gohugo.io"
|
|
||||||
}
|
|
||||||
|
|
||||||
return url.Parse(testServer.URL)
|
return url.Parse(testServer.URL)
|
||||||
}},
|
}},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue