From 801bbefc1900fa65f2c5b7b43bddbe52ba0119b7 Mon Sep 17 00:00:00 2001 From: Marcos Lilljedahl Date: Thu, 10 Aug 2017 11:47:36 -0300 Subject: [PATCH] Keep scheme when redirecting --- handlers/new_session.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/handlers/new_session.go b/handlers/new_session.go index 161ba24..c139341 100644 --- a/handlers/new_session.go +++ b/handlers/new_session.go @@ -62,7 +62,7 @@ func NewSession(rw http.ResponseWriter, req *http.Request) { } if stack != "" { - http.Redirect(rw, req, fmt.Sprintf("http://%s/p/%s", hostname, s.Id), http.StatusFound) + http.Redirect(rw, req, fmt.Sprintf("%s://%s/p/%s", req.URL.Scheme, hostname, s.Id), http.StatusFound) return } http.Redirect(rw, req, fmt.Sprintf("http://%s/p/%s", hostname, s.Id), http.StatusFound)