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:
parent
28abcf50e2
commit
0691e5ee34
4 changed files with 303 additions and 0 deletions
1
testdata/config.valid.yaml
vendored
1
testdata/config.valid.yaml
vendored
|
|
@ -14,6 +14,7 @@ site:
|
|||
strip_fragment: true
|
||||
collapse_numeric_segments: true
|
||||
max_segments: 5
|
||||
normalize_trailing_slash: true
|
||||
|
||||
limits:
|
||||
max_paths: 1000
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue