mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-30 22:34:15 -05:00
11eee95222
The Handler interface expects a first return value of 0 if headers have already been written. (cf. https://godoc.org/github.com/caddyserver/caddy/caddyhttp/httpserver#Handler) When using http.Redirect, this is the case as http.Redirect does write headers. When using Caddy with nested handlers, returning http.StatusMovedPermanently could cause a wrong (200) response on a non-slashy request on a directory name. Returning 0 ensures the redirection will always take place. |
||
---|---|---|
.. | ||
fileserver.go | ||
fileserver_test.go |