Utility function to strip the URL from the hostname provided by app.cfg.App.Host
(app *App)
| 32 | |
| 33 | // Utility function to strip the URL from the hostname provided by app.cfg.App.Host |
| 34 | func stripHostProtocol(app *App) string { |
| 35 | u, err := url.Parse(app.cfg.App.Host) |
| 36 | if err != nil { |
| 37 | // Fall back to host, with scheme stripped |
| 38 | return string(regexp.MustCompile("^.*://").ReplaceAll([]byte(app.cfg.App.Host), []byte(""))) |
| 39 | } |
| 40 | return u.Hostname() |
| 41 | } |
| 42 | |
| 43 | func handleGopher(app *App, w gopher.ResponseWriter, r *gopher.Request) error { |
| 44 | parts := strings.Split(r.Selector, "/") |
no outgoing calls
no test coverage detected