always use http scheme for localhost
authorNathan Youngman <git@nathany.com>
Thu, 1 Jan 2015 15:32:56 +0000 (08:32 -0700)
committerbep <bjorn.erik.pedersen@gmail.com>
Thu, 1 Jan 2015 22:57:29 +0000 (23:57 +0100)
fixes #758

commands/server.go
commands/server_test.go

index fbb051d1676334b5e1ab846aba4aa9245b8037bd..8299a291612d1ec917afabe8a309ffa4b8fdd6f0 100644 (file)
@@ -152,6 +152,7 @@ func fixUrl(s string) (string, error) {
        if serverAppend {
                if useLocalhost {
                        u.Host = fmt.Sprintf("localhost:%d", serverPort)
+                       u.Scheme = "http"
                        return u.String(), nil
                }
                host := u.Host
index f2a292037375e820b7a93d3253d3272ab4da6026..d53a15b78f3e868f5a152e5b022784e1d7e352c1 100644 (file)
@@ -17,7 +17,7 @@ func TestFixUrl(t *testing.T) {
        }
        tests := []data{
                {"Basic http localhost", "", "http://foo.com", true, 1313, "http://localhost:1313"},
-               {"Basic https localhost", "", "https://foo.com", true, 1313, "https://localhost:1313"},
+               {"Basic https production, http localhost", "", "https://foo.com", true, 1313, "http://localhost:1313"},
                {"Basic subdir", "", "http://foo.com/bar", true, 1313, "http://localhost:1313/bar"},
                {"Basic production", "http://foo.com", "http://foo.com", false, 80, "http://foo.com"},
                {"Production subdir", "http://foo.com/bar", "http://foo.com/bar", false, 80, "http://foo.com/bar"},