Skip to content
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

ResponseFilter to skip body logging only for certain URLs #875

Closed
thestral1337 opened this issue Oct 27, 2020 · 1 comment
Closed

ResponseFilter to skip body logging only for certain URLs #875

thestral1337 opened this issue Oct 27, 2020 · 1 comment

Comments

@thestral1337
Copy link

I want to skip the logging of the body response for certain URLs, but using a ResponseFilter I don't have any information about the request into the HttpResponse object. Am I missing something? Wouldn't it be better for the object HttpResponse to carry the relative HttpRequest that originated it?
Is there any workaround I can use?

.responseFilter(new ResponseFilter() {
@OverRide public HttpResponse filter(HttpResponse response) {
//Filter only specific responses by URL
return response.withoutBody();
}
})

@whiskeysierra
Copy link
Collaborator

A custom Strategy gives you both, the request and the response, to do that. See e.g.

@Override
public HttpResponse process(final HttpRequest request, final HttpResponse response) {
return response.withoutBody();
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants