Percent-decode URL parameters before parsing them (closes #103)
check / check (push) Canceled after 0s

chi matches routes against the escaped path when a request has one and
hands the handlers their URL parameters still percent-encoded. The home
page's lookup form encodes the address it asks for, so every IPv6 lookup
answered 400, as did a comma-separated address list or a prefix that a
client percent-encoded. The router now matches against the decoded path,
so every handler reads its parameters decoded.

Model: opus-5-5
This commit was merged in pull request #123.
This commit is contained in:
2026-10-19 23:02:00 +02:00
parent ef32082339
commit d2a6e30360
3 changed files with 93 additions and 9 deletions
+1
View File
@@ -12,6 +12,7 @@ func (s *Server) setupRoutes() {
r := chi.NewRouter()
// Middleware
r.Use(DecodedPathMiddleware)
r.Use(middleware.RequestID)
r.Use(middleware.RealIP)
r.Use(RequestLoggerMiddleware(s.logger.Logger)) // Structured request logging