Files
masyunis/test/double_slash/README.md
T
sol_bot Bot e07de898cd Import Anubis v1.28.2
Replace the tree with upstream TecharoHQ/anubis v1.28.2 (a1384fbf42e3).
Masyunis customizations are re-applied in the following commits.
2026-11-28 14:52:26 +03:00

12 lines
760 B
Markdown

# Allow double-slashes in paths
This test ensures that paths of the form `//foo` get passed to the target server as `//foo`.
## Tale of woe
Gentoo's wiki has pages named after configuration files. Prior to this fix, Anubis passed everything through [net/http#ServeMux](https://pkg.go.dev/net/http#ServeMux). ServeMux cleans paths to remove common client errors like two slashes in a row. This is a problem for servers that actually want it.
To fix it, Anubis needed to use some prefix comparison logic to dispatch to ServeMux and then otherwise reverse proxy to the target service. This preserves the double slashes.
This smoke test reads [input.txt](./input.txt) and passes every path to httpdebug, making sure the path comes out right on the other end.