Create request_id directive #1590 (#1711)

* Create request_id directive #1590

* Address Comments

* Fix TestListenerAddrEqual

* requestid: Add some tests

* Address Comments by tobya

* Address Comments
This commit is contained in:
Toby Allen
2017-06-24 21:54:35 +01:00
committed by Matt Holt
parent b0ab3d4281
commit 133ed18374
12 changed files with 346 additions and 1 deletions
+3
View File
@@ -243,6 +243,9 @@ func (r *replacer) getSubstitution(key string) string {
case "{path_escaped}":
u, _ := r.request.Context().Value(OriginalURLCtxKey).(url.URL)
return url.QueryEscape(u.Path)
case "{request_id}":
reqid, _ := r.request.Context().Value(RequestIDCtxKey).(string)
return reqid
case "{rewrite_path}":
return r.request.URL.Path
case "{rewrite_path_escaped}":