diff --git a/README.md b/README.md index 5dea7d3..aeda2c3 100644 --- a/README.md +++ b/README.md @@ -8,10 +8,9 @@ BitBucket, etc.). A commonly used vanity import path is ## Features - - Redirects browsers to godoc.org + - Redirects browsers to godoc.org (or somewhere else) - Redirects Go tool to VCS - Redirects godoc.org to browsable files - - Redirects HTTP to HTTPS ## Installation diff --git a/vanity.go b/vanity.go index 7af7e48..0bf6bf7 100644 --- a/vanity.go +++ b/vanity.go @@ -1,3 +1,7 @@ +/* +Package vanity implements custom import paths (Go vanity URLs) as an HTTP +handler that can be installed at the vanity URL. +*/ package vanity // import "go.jonnrb.io/vanity" import ( @@ -105,13 +109,6 @@ Nothing to see here; move along. func handlerFrom(tpl *template.Template, redir Redirector) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - // Redirect to https. - if r.URL.Scheme == "http" { - r.URL.Scheme = "https" - http.Redirect(w, r, r.URL.String(), http.StatusMovedPermanently) - return - } - // Only method supported is GET. if r.Method != http.MethodGet { status := http.StatusMethodNotAllowed