New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HttpExchangeTracer#postProcessRequestHeaders is never called #13924
Comments
As far as I can see only a defined set of headers are included (your custom header won't). This looks like something we did on purpose (can't trace back why at the moment) so that protected method is probably an oversight and should have been removed. Does that custom header shows at the moment? What is the name of the header? |
Thanks for quick response. The custom header is visible in the traces. The name is |
I think it's a bug that we don't offer some way to do this, even if it's not via |
Yes, I've some polish locally already and forgot to report here. |
@snicoll just a suggestion.. can you make this possible by adding a configuration property to |
Sorry but that's not the plan in this very issue. We're going to restore the 1.5.x behaviour but feel free to open a separate issue for that suggestion. |
Hi, my use case is to remove/sanitize a specific custom header from the response of
/httptrace
endpoint. I did some digging in the code and tried to provide my own implementaion ofHttpExchangeTracer
which haspostProcessRequestHeaders()
method. I overrode this method to sanitize my custom header. But it didn't work. On doing some more digging, i noticed thatpostProcessRequestHeaders()
method is not being called from anywhere. I am on Spring Boot 2.0.3.I checked the code of Spring Boot 1.5.7, and found that there is class called
WebRequestTraceFilter
which has methodpostProcessRequestHeaders()
. In boot 1.5.7 this method is being called from a private methodorg.springframework.boot.actuate.trace.WebRequestTraceFilter.getRequestHeaders(HttpServletRequest)
.Is there a simple way of achieveing what i am trying to achieve.
Few things i tried in spring boot 2.0.3:
org.springframework.boot.actuate.web.trace.servlet.TraceableHttpServletRequest.getHeaders()
but the class itself is final and package-private.org.springframework.boot.actuate.trace.http.HttpExchangeTracer.FilteredTraceableRequest.getHeaders()
but again same issue.The text was updated successfully, but these errors were encountered: