-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Description
Currently there is no way to use request headers in response_headers_to_add (it doesn't support %REQ(header-name)%).
However it would be nice to have an access to certain headers, namely x-request-id.
Normally a backend would echo the x-request-id header, so that it would be proxied to a client.
When there is a request timeout, envoy sends the "504 upstream request timeout" reply, and the client doesn't get the x-request-id.
Although it might be useful to echo other envoy-generated request headers (e.g. uber-trace-id for traces), for now it would be sufficient to add the %REQUEST_ID% in StreamInfoHeaderFormatter, requestId in StreamInfo, and set it in the http connection manager together with setDownstreamRemoteAddress, after the ConnectionManagerUtility::mutateRequestHeaders call.