-
Notifications
You must be signed in to change notification settings - Fork 41.6k
Description
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 of HttpExchangeTracer which has postProcessRequestHeaders() method. I overrode this method to sanitize my custom header. But it didn't work. On doing some more digging, i noticed that postProcessRequestHeaders() 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 method postProcessRequestHeaders(). In boot 1.5.7 this method is being called from a private method org.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:
- tried overriding
org.springframework.boot.actuate.web.trace.servlet.TraceableHttpServletRequest.getHeaders()but the class itself is final and package-private. - triedd overriding
org.springframework.boot.actuate.trace.http.HttpExchangeTracer.FilteredTraceableRequest.getHeaders()but again same issue.