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

Case insensitive host rule #3931

Merged
merged 4 commits into from
Oct 25, 2018
Merged

Conversation

bgandon
Copy link
Contributor

@bgandon bgandon commented Sep 26, 2018

What does this PR do?

This PR introduces a failing test for issue #3930.

Here we also rename parameters and variables in the hostRegexp() function to better reflect what is actually handled. Indeed, this function is written as if it was manipulating plain hostnames, whereas it actually handles host patterns that might include regular expressions.

Motivation

I wanted to demonstrate the issue #3930, and also address a misnaming that was pointed out while analyzing that issue.

More

  • Added/updated tests
  • Added/updated documentation

Additional Notes

Relates to #3930.

@bgandon
Copy link
Contributor Author

bgandon commented Sep 26, 2018

It's normal that tests are failing because the fix is in containous/mux#5.

@juliens
Copy link
Member

juliens commented Oct 24, 2018

Thanks you for your PR.

I made a PR on containous/mux#6.
With this PR we can remove the strings.ToLower https://github.com/containous/traefik/blob/6a55772cda1684546a6a5456b6847e0f9b3df44d/rules/rules.go#L59 and your tests should pass.

Do you think you can add a test to verify that the rule HostRegex:CASE.test.com match case.test.com, and that HostRegex:case.test.com match CASE.test.com?

Moreover, this a bug fix so I think we can merge it in the next 1.7. Can you make this PR on the 1.7 branch?

@ldez ldez changed the title Failing test for #3930 & some renaming in hostRegexp() function Case insensitive host rule Oct 24, 2018
@ldez ldez changed the base branch from master to v1.7 October 24, 2018 15:39
Copy link
Contributor

@ldez ldez left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@juliens juliens left a comment

Choose a reason for hiding this comment

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

LGTM

@ldez ldez force-pushed the improve-hostRegexp-func branch 2 times, most recently from 437ce38 to f735001 Compare October 24, 2018 16:21
Copy link
Member

@mmatur mmatur left a comment

Choose a reason for hiding this comment

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

LGTM

@bgandon
Copy link
Contributor Author

bgandon commented Oct 26, 2018

Thank you guys for merging!
Shall we close the related issue #3930?

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

Successfully merging this pull request may close these issues.

6 participants