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

Add edge case for root path with rewrite-target #6005

Merged
merged 1 commit into from
Dec 19, 2019

Conversation

dtomcej
Copy link
Contributor

@dtomcej dtomcej commented Dec 11, 2019

What does this PR do?

This PR:

  • Fixes behavior of an edge case with rewrite-target

Motivation

Fixes #5990

More

  • Added/updated tests
  • Added/updated documentation - None needed, bugfix

Additional Notes

This edge case was where we trim the trailing slashes on the rewrite-target before appending the contents of the matched path. This behavior was required becuase it ensures that we don't duplicate slashes.

However, it introduced an edge case where if the trailing slash was the leading slash, it could get lost.

This is that edge case. The solution here is to capture the leading slash as part of the path capture group, and append it to the rewrite target.

@seboudry
Copy link

Tested on own docker image builded with make image.
Both URLs mentioned on #5990 (comment) respond correctly.

Copy link
Collaborator

@SantoDE SantoDE 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
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

@ldez ldez removed the request for review from a team December 17, 2019 16:30
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

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