From fadb2aed97e1012d5e7fac5d032401bf41b7e370 Mon Sep 17 00:00:00 2001 From: Adnan Maolood Date: Sat, 20 Feb 2021 16:45:37 -0500 Subject: [PATCH] mux: Use StatusHandler instead of RedirectHandler --- mux.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mux.go b/mux.go index 1d45d47..7b449d0 100644 --- a/mux.go +++ b/mux.go @@ -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()