Keep scheme when redirecting

This commit is contained in:
Marcos Lilljedahl
2017-08-10 11:47:36 -03:00
parent cfc03b2826
commit 801bbefc19

View File

@@ -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)