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

Enable prefix matching within slash boundaries #2214

Merged

Conversation

mjeri
Copy link
Contributor

@mjeri mjeri commented Oct 4, 2017

This PR enables stripping prefixes not only on slash boundaries but also inside of them. The actual mux routing was always capable of routing within the slash boundaries, only the prefix wasn't stripped properly.

Consider we have a fronted rule like PathPrefixStrip:/stat and we are calling Traefik with a Path like /status. This would route the request to the frontend/it's connected backends but the path wouldn't be stripped. With the fix provided in this PR it will properly strip and forward a path like /us.

While fixing this problem I realized that the stripPrefix middleware could actually be simplified while keeping all tests working properly.

As there was no bug-report by any other Traefik users I am unsure whether we still want to bring this into the 1.4 release. Let me know if I should switch PR to master instead.

Copy link
Contributor

@timoreimann timoreimann left a comment

Choose a reason for hiding this comment

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

@marco-jantke and I pair-programmed on this one, so consequently I LGTM to this one.

Copy link
Member

@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

@traefiker traefiker force-pushed the enable-prefix-matching-within-slash-boundaries branch from 3db8330 to 482daf4 Compare October 6, 2017 09:22
@traefiker traefiker merged commit fd70e6e into traefik:v1.4 Oct 6, 2017
@ldez ldez changed the title enable prefix matching within slash boundaries Enable prefix matching within slash boundaries Oct 10, 2017
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.

None yet

5 participants