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

ReplacePathRegex - Allow Empty String for replacement #10527

Closed
2 tasks done
danhlee329 opened this issue Mar 15, 2024 · 3 comments
Closed
2 tasks done

ReplacePathRegex - Allow Empty String for replacement #10527

danhlee329 opened this issue Mar 15, 2024 · 3 comments

Comments

@danhlee329
Copy link

danhlee329 commented Mar 15, 2024

Welcome!

  • Yes, I've searched similar issues on GitHub and didn't find any.
  • Yes, I've searched similar issues on the Traefik community forum and didn't find any.

What did you expect to see?

Currently using v2.10.7, would like to request passing in an empty string for the replacement entry for the ReplacePathRegex middleware. At the moment, I see that it requires the replacement entry to not be empty (with it trimmed first).

Main use case for this request is to remove any trailing slashes from the path without having to redirect (EDIT: it is acceptable to only remove the first trailing-slash for us):

http:
  middlewares:
    remove-trailing-slash-from-path:
      replacepathregex:
        regex: "/$"
        replacement: ""

Some points around the request/confusion:

Any Traefik-ers have suggestions around how to do this with the latest version of Traefik, it'll be greatly appreciated, would like this to be considered as a feature request, thanks!

@rtribotte
Copy link
Member

Hello @danhlee329,

Thanks for opening this!

#10538 is opened to fix this issue.

@danhlee329
Copy link
Author

Hello @danhlee329,

Thanks for opening this!

#10538 is opened to fix this issue.

Awesome, thank you @rtribotte!

@traefiker traefiker added this to the 2.11 milestone Mar 26, 2024
@traefiker
Copy link
Contributor

Closed by #10538.

@traefik traefik locked and limited conversation to collaborators Apr 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants