1
0
Fork 0
mirror of https://git.sr.ht/~adnano/go-gemini synced 2024-05-19 00:46:04 +02:00

mux: Use StatusHandler instead of RedirectHandler

This commit is contained in:
Adnan Maolood 2021-02-20 16:45:37 -05:00
parent 252fe678fd
commit fadb2aed97

4
mux.go
View File

@ -185,13 +185,13 @@ func (mux *ServeMux) Handler(r *Request) Handler {
// If the given path is /tree and its handler is not registered,
// redirect for /tree/.
if u, ok := mux.redirectToPathSlash(muxKey{scheme, host, path}, r.URL); ok {
return RedirectHandler(StatusPermanentRedirect, u.String())
return StatusHandler(StatusPermanentRedirect, u.String())
}
if path != r.URL.Path {
u := *r.URL
u.Path = path
return RedirectHandler(StatusPermanentRedirect, u.String())
return StatusHandler(StatusPermanentRedirect, u.String())
}
mux.mu.RLock()