mirror of
https://github.com/gohugoio/hugo.git
synced 2025-01-14 15:50:55 +00:00
Fix remote test on Go 1.4
This commit is contained in:
parent
89f8fa586c
commit
31035f8ad1
1 changed files with 6 additions and 1 deletions
|
@ -20,6 +20,7 @@ import (
|
||||||
"net/http/httptest"
|
"net/http/httptest"
|
||||||
"net/url"
|
"net/url"
|
||||||
"os"
|
"os"
|
||||||
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
@ -115,7 +116,11 @@ 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 = "Host: gohugo.io"
|
|
||||||
|
if !strings.Contains("go1.4", runtime.Version()) {
|
||||||
|
r.Host = "Host: gohugo.io"
|
||||||
|
}
|
||||||
|
|
||||||
return url.Parse(testServer.URL)
|
return url.Parse(testServer.URL)
|
||||||
}},
|
}},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue