Skip to content

Allow to configure the referrers validator with the old behavior#190

Merged
davidor merged 4 commits intomasterfrom
referrer-filter-legacy
Apr 16, 2020
Merged

Allow to configure the referrers validator with the old behavior#190
davidor merged 4 commits intomasterfrom
referrer-filter-legacy

Conversation

@davidor
Copy link
Copy Markdown
Contributor

@davidor davidor commented Apr 9, 2020

This PR introduces a new configuration option to select the referrers validator behavior.

This is needed because there are some users that depend on the old behavior and forcing them to use the new one would break their work flow.

@davidor davidor requested a review from unleashed April 9, 2020 15:33
Copy link
Copy Markdown
Contributor

@unleashed unleashed left a comment

Choose a reason for hiding this comment

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

Consider the changes in the comments and ping me again.

Comment thread lib/3scale/backend/validators/referrer.rb Outdated
Comment thread test/unit/validators/referrer_test.rb
Comment thread lib/3scale/backend/validators/referrer.rb Outdated
@davidor davidor force-pushed the referrer-filter-legacy branch from 86ec6b1 to 1c5287e Compare April 16, 2020 10:15
@davidor davidor requested a review from unleashed April 16, 2020 10:26
Copy link
Copy Markdown
Contributor

@unleashed unleashed left a comment

Choose a reason for hiding this comment

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

👍. The only consideration is that you could leave the common code in the matches? method (escaping and replacing, which you could also do in place with gsub!) and just change the regex in the pattern_matches? method.

@davidor davidor force-pushed the referrer-filter-legacy branch from 1c5287e to 569a989 Compare April 16, 2020 11:37
@davidor davidor force-pushed the referrer-filter-legacy branch from 569a989 to cd10873 Compare April 16, 2020 12:04
@davidor
Copy link
Copy Markdown
Contributor Author

davidor commented Apr 16, 2020

I changed that to avoid duplication 👍

@davidor davidor merged commit d1e6bc4 into master Apr 16, 2020
@bors bors Bot deleted the referrer-filter-legacy branch April 16, 2020 12:12
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