This filthy hack works in conjunction with hostPortStrip to restore the original request host after mux match.
(r *http.Request)
| 68 | // This filthy hack works in conjunction with hostPortStrip to restore the |
| 69 | // original request host after mux match. |
| 70 | func 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 |