(r *http.Request, redirectPort string)
| 6 | ) |
| 7 | |
| 8 | func targetForRequest(r *http.Request, redirectPort string) string { |
| 9 | host, _, err := net.SplitHostPort(r.Host) |
| 10 | if err != nil { |
| 11 | host = r.Host |
| 12 | } |
| 13 | r.URL.Host = host |
| 14 | if redirectPort != "443" { |
| 15 | r.URL.Host += ":" + redirectPort |
| 16 | } |
| 17 | r.URL.Scheme = "https" |
| 18 | return r.URL.String() |
| 19 | } |
| 20 | |
| 21 | func httpsRedirect(redirectPort string) func(w http.ResponseWriter, r *http.Request) { |
| 22 | return func(w http.ResponseWriter, r *http.Request) { |
no outgoing calls
searching dependent graphs…