Misc. changes: {hostonly} placeholder, self_signed port fix

This commit is contained in:
Matthew Holt
2016-07-02 14:10:57 -06:00
parent 32329a473d
commit 227664336e
4 changed files with 11 additions and 4 deletions
+8 -1
View File
@@ -69,7 +69,14 @@ func NewReplacer(r *http.Request, rr *ResponseRecorder, emptyValue string) Repla
}
return name
}(),
"{host}": r.Host,
"{host}": r.Host,
"{hostonly}": func() string {
host, _, err := net.SplitHostPort(r.Host)
if err != nil {
return r.Host
}
return host
}(),
"{path}": r.URL.Path,
"{path_escaped}": url.QueryEscape(r.URL.Path),
"{query}": r.URL.RawQuery,