diff --git a/httpr.go b/httpr.go index ad79a10..700bb99 100644 --- a/httpr.go +++ b/httpr.go @@ -38,14 +38,13 @@ func newPath(path string) (path, error) { // newServePath is a reduced version of newPath for ServeHTTP. func newServePath(path string) (path, error) { - pathLen := len(path) - if path[0] != '/' { return nil, errors.New("path should start with a slash symbol \"/\"") } path = strings.ReplaceAll(path, "//", "/") + pathLen := len(path) if path[pathLen-1] == '/' { path = path[:pathLen-1] }