Skip to content

Commit a566951

Browse files
committed
Revert change that broke routing
I don't know why I assumed this would be fine.
1 parent 99c6f17 commit a566951

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/website/requesthandling.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,14 +114,17 @@ func (r *Router) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
114114
method = http.MethodGet // HEADs map to GETs for the purposes of routing
115115
}
116116

117-
currentPath := hmnurl.NormalizePath(req.URL.Path)
118-
119117
nextroute:
120118
for _, route := range r.Routes {
121119
if route.Method != "" && method != route.Method {
122120
continue
123121
}
124122

123+
currentPath := strings.TrimSuffix(req.URL.Path, "/")
124+
if currentPath == "" {
125+
currentPath = "/"
126+
}
127+
125128
var params map[string]string
126129
for _, regex := range route.Regexes {
127130
match := regex.FindStringSubmatch(currentPath)

0 commit comments

Comments
 (0)