diff --git a/server.go b/server.go index 1bc9197..8187e71 100644 --- a/server.go +++ b/server.go @@ -284,6 +284,10 @@ func (m *ServeMux) Handle(pattern string, handler Handler) { if err != nil { panic(err) } + // Trim trailing slash from URL path + if len(url.Path) != 0 && url.Path[len(url.Path)-1] == '/' { + url.Path = url.Path[:len(url.Path)-1] + } e := muxEntry{ url, handler,