pages-server/server/upstream
Daniel Erat 69fb22a9e7 Avoid extra slashes in redirects with :splat (#308)
Remove leading slashes from captured portions of paths when
redirecting using splats. This makes a directive like
"/articles/*  /posts/:splat  302" behave as described in
FEATURES.md, i.e. "/articles/foo" now redirects to
"/posts/foo" rather than to "/posts//foo". Fixes #269.

This also changes the behavior of a redirect like
"/articles/*  /posts:splat  302". "/articles/foo" will now
redirect to "/postsfoo" rather than to "/posts/foo".

This change also fixes an issue where paths like
"/articles123" would be incorrectly matched by the above
patterns.

Reviewed-on: https://codeberg.org/Codeberg/pages-server/pulls/308
Reviewed-by: crapStone <codeberg@crapstone.dev>
Co-authored-by: Daniel Erat <dan@erat.org>
Co-committed-by: Daniel Erat <dan@erat.org>
2024-04-20 11:00:15 +00:00
..
domains.go Add config file and rework cli parsing and passing of config values (#263) 2024-02-15 16:08:29 +00:00
header.go Refactor split long functions (#135) 2022-11-12 20:43:44 +01:00
helper.go Add cert store option based on sqlite3, mysql & postgres (#173) 2023-02-10 03:00:14 +00:00
redirects_test.go Avoid extra slashes in redirects with :splat (#308) 2024-04-20 11:00:15 +00:00
redirects.go Avoid extra slashes in redirects with :splat (#308) 2024-04-20 11:00:15 +00:00
upstream.go FIX blank internal pages (#164) (#292) 2024-02-26 22:21:42 +00:00