diff --git a/http.go b/http.go index d506f7b..ae0de0e 100644 --- a/http.go +++ b/http.go @@ -44,6 +44,12 @@ func redirectHandler(w http.ResponseWriter, r *http.Request) { return } + scheme := r.URL.Scheme + + if scheme == "" { + scheme = "https" + } + redirectPath := path.Join(server.Path, r.URL.Path) if dlMap != nil { @@ -54,7 +60,7 @@ func redirectHandler(w http.ResponseWriter, r *http.Request) { } u := &url.URL{ - Scheme: realProto(r), + Scheme: scheme, Host: server.Host, Path: redirectPath, }