tomcat icon indicating copy to clipboard operation
tomcat copied to clipboard

Added optional X-Request-Id to RemoteIpFilter

Open isapir opened this issue 1 year ago • 3 comments

This patch adds an optional requestIdHeader configuration to RemoteIpFilter, that when used, sets the XForwardedRequest.requestId to the value passed with that header.

By default, requestIdHeader is set to an empty string and is effectively disabled, thus maintaining backwards compatibility. Setting a value in the filter config, e.g. to "X-Request-Id", allows proxy servers or the client application to specify a Request ID, e.g. X-Request-Id: abcd-1234 which is then returned via getReuqestId().

I wanted to do the same for RemoteIpValve but it looks like there we do not use the XForwardedRequest and other changes will be required.

Feedback welcome.

isapir avatar Oct 02 '24 04:10 isapir