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

create support for absent header condition #1025

Conversation

Mikhail-Polivakha
Copy link
Contributor

Description

Create additional condition in order to support condition - "header is absent in http request"

Motivation and Context

Encounter in our project. Requirement was to disable logging for requests (and corresponding responses) without certain headers

Types of changes

New feature (and corresponding tests for it also goes along)

Checklist:

Required tests have been already created. Consider to doc this change somewhere. If you will provide me with the link I can supply with one :)

@@ -78,4 +78,8 @@ private Conditions() {
e.getValue().stream().anyMatch(v -> predicate.test(e.getKey(), v)));
}

public static <T extends HttpMessage> Predicate<T> withoutHeader(String headerName) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public static <T extends HttpMessage> Predicate<T> withoutHeader(String headerName) {
public static <T extends HttpMessage> Predicate<T> withoutHeader(final String headerName) {

@whiskeysierra
Copy link
Collaborator

👍

@whiskeysierra whiskeysierra merged commit a571cf9 into zalando:main May 7, 2021
@whiskeysierra
Copy link
Collaborator

Thank you for your contribution! 📣

I released your change as 2.8.0 to central.

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

Successfully merging this pull request may close these issues.

2 participants