MCPcopy
hub / github.com/cortesi/devd / revertOriginalHost

Function revertOriginalHost

server.go:70–76  ·  view source on GitHub ↗

This filthy hack works in conjunction with hostPortStrip to restore the original request host after mux match.

(r *http.Request)

Source from the content-addressed store, hash-verified

68// This filthy hack works in conjunction with hostPortStrip to restore the
69// original request host after mux match.
70func revertOriginalHost(r *http.Request) {
71 original := r.Header.Get("_devd_original_host")
72 if original != "" {
73 r.Host = original
74 r.Header.Del("_devd_original_host")
75 }
76}
77
78// We can remove the mangling once this is fixed:
79// https://github.com/golang/go/issues/10463

Callers 1

WrapHandlerMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected