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

[bug] Wrong URL matching when url containing encoded slash (%2F) #639

Closed
gorshkov-leonid opened this issue Sep 3, 2021 · 1 comment
Closed

Comments

@gorshkov-leonid
Copy link

gorshkov-leonid commented Sep 3, 2021

I found a lot of similar issues here but with some resolution results. But I think I ought to create this issue because think problem is still actual.

I use /repositories/{id}/{branch} and /repositories/{id}/{branch}/files/structure. When I use branch feature/task1 (of cause, encoded as feature%2Ftask1) then it is not working.
I am aware of:

  • router.UseEncodedPath()
  • {branch:.+} pattern

router.UseEncodedPath() disables auto decoding of path components. In this case, I have to decode it additionally. It is not handy.

{branch:.+} brokes behavior. For example /repositories/{id}/{branch:.+} matches /repositories/123/feature%2Ftask1/files/structure. So this is wrong way.

I think that mux works incorrectly. In my opinion URL matching should be done before decoding path components.

@gorshkov-leonid gorshkov-leonid changed the title [bug] Incorrect url matching with url containing encoded slash [bug] Wrong URL matching when url containing encoded slash (%2F) Sep 3, 2021
@stale
Copy link

stale bot commented Jan 9, 2022

This issue has been automatically marked as stale because it hasn't seen a recent update. It'll be automatically closed in a few days.

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

Successfully merging a pull request may close this issue.

1 participant