Fix remote test on Go 1.4
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Fri, 18 Dec 2015 15:05:24 +0000 (16:05 +0100)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Fri, 18 Dec 2015 15:05:24 +0000 (16:05 +0100)
tpl/template_resources_test.go

index e9264c2191e7e9560c218216c8c648382e97eb62..661c14cb5a8144fb0cfca5921acbff6ff54ddbfe 100644 (file)
@@ -20,6 +20,7 @@ import (
        "net/http/httptest"
        "net/url"
        "os"
+       "runtime"
        "strings"
        "testing"
        "time"
@@ -115,7 +116,11 @@ func getTestServer(handler func(w http.ResponseWriter, r *http.Request)) (*httpt
        testServer := httptest.NewServer(http.HandlerFunc(handler))
        client := &http.Client{
                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)
                }},
        }