1
0
mirror of https://github.com/rancher/norman.git synced 2025-09-18 08:14:56 +00:00

Fix scheme detection in URL

This commit is contained in:
Darren Shepherd
2018-01-22 19:06:34 -07:00
parent 0d8fd60120
commit 60fa30a605

View File

@@ -192,7 +192,11 @@ func parseRequestURL(r *http.Request) string {
}
// Use incoming url
return fmt.Sprintf("http://%s%s", r.Host, r.URL.Path)
scheme := "http"
if r.TLS != nil {
scheme = "https"
}
return fmt.Sprintf("%s://%s%s", scheme, r.Host, r.URL.Path)
}
func getURLFromStandardHeaders(r *http.Request) string {