(w http.ResponseWriter, r *http.Request)
| 155 | } |
| 156 | |
| 157 | func httpRedirectHandler(w http.ResponseWriter, r *http.Request) { |
| 158 | toURL := "https://" |
| 159 | |
| 160 | // since we redirect to the standard HTTPS port, we |
| 161 | // do not need to include it in the redirect URL |
| 162 | requestHost := hostOnly(r.Host) |
| 163 | |
| 164 | toURL += requestHost |
| 165 | toURL += r.URL.RequestURI() |
| 166 | |
| 167 | // get rid of this disgusting unencrypted HTTP connection 🤢 |
| 168 | w.Header().Set("Connection", "close") |
| 169 | |
| 170 | http.Redirect(w, r, toURL, http.StatusMovedPermanently) |
| 171 | } |
| 172 | |
| 173 | // TLS enables management of certificates for domainNames |
| 174 | // and returns a valid tls.Config. It uses the Default |
nothing calls this directly
no test coverage detected
searching dependent graphs…