Skip to content

Comments

fix: swap middleware order so stripPrefix runs before addPrefix#3759

Open
mixelburg wants to merge 1 commit intoDokploy:canaryfrom
mixelburg:fix/middleware-order-strip-before-addprefix
Open

fix: swap middleware order so stripPrefix runs before addPrefix#3759
mixelburg wants to merge 1 commit intoDokploy:canaryfrom
mixelburg:fix/middleware-order-strip-before-addprefix

Conversation

@mixelburg
Copy link
Contributor

@mixelburg mixelburg commented Feb 19, 2026

Fixes #3709

When both Strip Path and Internal Path are configured on a domain, the addPrefix middleware was being pushed onto the middlewares array before stripPrefix. Since Traefik executes middlewares in array order, this caused the prefix to be added to the full unstripped path.

Swapped the two blocks so stripPrefix runs first, matching the documented behavior.

Greptile Summary

Swapped middleware order in packages/server/src/utils/traefik/domain.ts:140-149 so stripPrefix executes before addPrefix. When both Strip Path and Internal Path are configured, Traefik processes middlewares in array order, so the strip operation must happen first to remove the external path before the internal path is added.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • Simple logic fix that corrects middleware execution order - no breaking changes, security issues, or complex logic introduced
  • No files require special attention

Last reviewed commit: 05c80f4

(4/5) You can add custom instructions or style guidelines for the agent here!

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

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.

Internal Path prepended before Strip Path, contradicting documented behavior

1 participant