We can remove the mangling once this is fixed: https://github.com/golang/go/issues/10463
(next http.Handler)
| 78 | // We can remove the mangling once this is fixed: |
| 79 | // https://github.com/golang/go/issues/10463 |
| 80 | func hostPortStrip(next http.Handler) http.Handler { |
| 81 | return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |
| 82 | host, _, err := net.SplitHostPort(r.Host) |
| 83 | if err == nil { |
| 84 | original := r.Host |
| 85 | r.Host = host |
| 86 | r.Header.Set("_devd_original_host", original) |
| 87 | } |
| 88 | next.ServeHTTP(w, r) |
| 89 | }) |
| 90 | } |
| 91 | |
| 92 | func matchStringAny(regexps []*regexp.Regexp, s string) bool { |
| 93 | for _, r := range regexps { |