Skip to content

fix: don't remove trailing slash when using path.Clean and path.Join#1269

Open
xqqp wants to merge 1 commit into
ory:masterfrom
xqqp:fix_trailing_slash
Open

fix: don't remove trailing slash when using path.Clean and path.Join#1269
xqqp wants to merge 1 commit into
ory:masterfrom
xqqp:fix_trailing_slash

Conversation

@xqqp

@xqqp xqqp commented Apr 7, 2026

Copy link
Copy Markdown

path.Join and path.Clean remove trailing slashes. This is an issue when the upstream server expects them to be contained in the URL path.

Example:
Upstream expects: http://host/path/1/
Client does request to http://host/path/1/ but Oathkeeper modifies the path to http://host/path/1.

With this PR, trailing slashes are added after using the two functions, if a trailing slash existed before.

Related issue(s)

#1266

Checklist

  • [x ] I have read the contributing guidelines.
  • [ x] I have referenced an issue containing the design document if my change
    introduces a new feature.
  • [ x] I am following the
    contributing code guidelines.
  • [ x] I have read the security policy.
  • [ ]x I confirm that this pull request does not address a security
    vulnerability. If this pull request addresses a security vulnerability, I
    confirm that I got the approval (please contact
    security@ory.com) from the maintainers to push
    the changes.
  • I have added tests that prove my fix is effective or that my feature
    works.
  • I have added or changed the documentation.

Further Comments

Tested locally.

@xqqp xqqp requested review from a team and aeneasr as code owners April 7, 2026 15:20
@CLAassistant

CLAassistant commented Apr 7, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@xqqp xqqp force-pushed the fix_trailing_slash branch from de0ec20 to 906743d Compare April 7, 2026 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants