(writer http.ResponseWriter,
request *http.Request)
| 17 | } |
| 18 | |
| 19 | func HTTPSRedirect(writer http.ResponseWriter, |
| 20 | request *http.Request) { |
| 21 | host := strings.Split(request.Host, ":")[0] |
| 22 | target := "https://" + host + ":5500" + request.URL.Path |
| 23 | if len(request.URL.RawQuery) > 0 { |
| 24 | target += "?" + request.URL.RawQuery |
| 25 | } |
| 26 | http.Redirect(writer, request, target, http.StatusTemporaryRedirect) |
| 27 | } |
| 28 | |
| 29 | func main() { |
| 30 | http.Handle("/message", StringHandler{ "Hello, World"}) |
nothing calls this directly
no outgoing calls
no test coverage detected