(wrap-request-id handler)(wrap-request-id handler
{:keys [header-names response-name id-fn]
:or {header-names ["x-request-id" "x-correlation-id"
"traceparent"]
response-name "X-Request-Id"
id-fn (fn* [] (str (random-uuid)))}})Attach a request id to req/resp.
Options: :header-names vector of header names to trust (default common ones) :response-name header name to set on the response (default "X-Request-Id") :id-fn 0-arg fn to generate an id (default random UUID)
Notes:
Attach a request id to req/resp. Options: :header-names vector of header names to trust (default common ones) :response-name header name to set on the response (default "X-Request-Id") :id-fn 0-arg fn to generate an id (default random UUID) Notes: - If a trusted incoming header is present and passes validation, it is used. - If "traceparent" is trusted, the W3C trace-id (32 hex chars) is used.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |