Skip to content

Conversation

rhuss
Copy link
Contributor

@rhuss rhuss commented Feb 4, 2016

String and java.util.regex.Pattern can both now be used as arguments to removeHeaders preprocessor method. When a Pattern is used then all matching headers are removed.

Fix gh-191

The CLA has been submitted.

@rhuss
Copy link
Contributor Author

rhuss commented Feb 4, 2016

Alternatively an extra method removeMatchingHeaders could be added. 'guess its more or less a matter of taste (loose typing vs. API inflation)

@wilkinsona
Copy link
Member

Thanks for the PR.

I'm not keen on removeHeaders taking an Object. I do like that it lets you mix patterns and strings, but, IMO, that's outweighed by the loss of type safety. I'd prefer to either have removeMatchingHeaders(String pattern) or overload removeHeaders with removeHeaders(Pattern pattern). I'm leaning towards the former as the user doesn't have to call Pattern.compile and the method name makes it clear that there's some matching involved.

A new preprocessor method `removeMatchingHeaders` has been introduced which takes one or more patterns (as strings) which are applied to header and remove the header if matching.

Fix spring-projectsgh-191
@rhuss
Copy link
Contributor Author

rhuss commented Feb 4, 2016

Ok, updated the PR accordingly (and rebased)

@wilkinsona wilkinsona closed this in 1897ec5 Feb 5, 2016
wilkinsona added a commit that referenced this pull request Feb 5, 2016
* gh-195:
  Polish pattern-based header removal contribution
  Add support for removing headers that match a Pattern
@wilkinsona
Copy link
Member

@rhuss Thanks very much for the PR. I've merged it into master. I made a few changes along the way. Please take a look at 1131c9f if you're interested.

@wilkinsona wilkinsona added this to the 1.1.0.M1 milestone Feb 5, 2016
@wilkinsona wilkinsona added the type: enhancement Enhancement that adds a new feature label Feb 5, 2016
@rhuss
Copy link
Contributor Author

rhuss commented Feb 11, 2016

Thanks for picking it up and also for tuning the code. Looks indeed nicer that way.

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

Labels

type: enhancement Enhancement that adds a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants