MCPcopy Index your code
hub / github.com/cortesi/devd / hostPortStrip

Function hostPortStrip

server.go:80–90  ·  view source on GitHub ↗

We can remove the mangling once this is fixed: https://github.com/golang/go/issues/10463

(next http.Handler)

Source from the content-addressed store, hash-verified

78// We can remove the mangling once this is fixed:
79// https://github.com/golang/go/issues/10463
80func 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
92func matchStringAny(regexps []*regexp.Regexp, s string) bool {
93 for _, r := range regexps {

Callers 1

RouterMethod · 0.85

Calls 1

ServeHTTPMethod · 0.45

Tested by

no test coverage detected