internal: implement path normalization w/ configurable rules

Strips query strings and URL fragmenets, prevents unbounded Prometheus
metrics by normalizing paths like:

- `/users/12345/profile -> /users/:id/profile`
- `/page?utm_source=twitter -> /page`
- `/a/../b -> /b`

etc.

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I72f2fa2452f4666567143d052b5716476a6a6964
This commit is contained in:
raf 2026-03-01 01:13:58 +03:00
commit 0691e5ee34
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
4 changed files with 303 additions and 0 deletions

View file

@ -14,6 +14,7 @@ site:
strip_fragment: true
collapse_numeric_segments: true
max_segments: 5
normalize_trailing_slash: true
limits:
max_paths: 1000