hugo

Unnamed repository; edit this file 'description' to name the repository.

git clone git://git.shimmy1996.com/hugo.git
commit c6f4b09f653644b9ed9186c6fdefa8e1b571dcc1
parent dd1001ceda08c11ad25a505c22a0550bed42d863
Author: Nathan Youngman <git@nathany.com>
Date:   Thu,  1 Jan 2015 08:32:56 -0700

always use http scheme for localhost

fixes #758

Diffstat:
Mcommands/server.go | 1+
Mcommands/server_test.go | 2+-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/commands/server.go b/commands/server.go
@@ -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
diff --git a/commands/server_test.go b/commands/server_test.go
@@ -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"},