mirror of
https://github.com/fosrl/pangolin.git
synced 2026-05-06 00:22:42 -05:00
[PR #2524] [MERGED] fix: path-based routing broken due to key collisions in sanitize() #7814
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/fosrl/pangolin/pull/2524
Author: @shreyaspapi
Created: 2/23/2026
Status: ✅ Merged
Merged: 3/8/2026
Merged by: @oschwartz10612
Base:
dev← Head:fix/2294-path-based-routing📝 Commits (4)
5f18c06fix: use collision-free path encoding for Traefik router key generatione58f0c9fix: preserve backward-compatible router names while fixing path collisions244f497test: add comprehensive backward compatibility tests for path routing fix75a9097fix: simplify path encoding per review — inline utils, use single key scheme📊 Changes
4 files changed (+364 additions, -13 deletions)
View changed files
📝
server/lib/traefik/getTraefikConfig.ts(+9 -7)➕
server/lib/traefik/pathEncoding.test.ts(+323 -0)📝
server/lib/traefik/utils.ts(+20 -0)📝
server/private/lib/traefik/getTraefikConfig.ts(+12 -6)📄 Description
Community Contribution License Agreement
By creating this pull request, I grant the project maintainers an unlimited,
perpetual license to use, modify, and redistribute these contributions under any terms they
choose, including both the AGPLv3 and the Fossorial Commercial license terms. I
represent that I have the right to grant this license for all contributed content.
Description
Fixes #2294
What this fixes
The
sanitize()function used to generate internal map keys for grouping targets ingetTraefikConfigcan cause path collisions. It replaces all non-alphanumeric characters (including/,.,_) with dashes and collapses them, so structurally different paths can produce the same key:sanitize("/a/b")="a-b"sanitize("/a-b")="a-b"(same!)When two targets get the same key, they're grouped into one loadbalancer service and Traefik round-robins between them instead of routing by path.
Note: this specific collision doesn't affect the
/vs/apiscenario reported in the issue (those already produce different keys), but it would affect setups with paths like/api/v1vs/api-v1or/app.v2vs/app/v2.How to test?
/api/v1and/api-v1)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.