https_redirect.go
func HTTPToHTTPSRedirectHandler(w http.ResponseWriter, r *http.Request) {
	url := r.URL
	url.Scheme = "https"
	if url.Host == "" {
		url.Host = r.Host
	}
	w.Header().Set("Location", url.String())
	w.WriteHeader(http.StatusMovedPermanently)
}
func HTTPToHTTPSRedirectHandler(w http.ResponseWriter, r *http.Request) {
	url := r.URL
	url.Scheme = "https"
	if url.Host == "" {
		url.Host = r.Host
	}
	w.Header().Set("Location", url.String())
	w.WriteHeader(http.StatusMovedPermanently)
}
// HTTPToHTTPSRedirectHandler redirects with status code 301 to a https://
// version of HTTP request.