Skip to content

Commit 370874c

Browse files
committed
short: handle trailing slash
1 parent cae3f36 commit 370874c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

short.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ func (s *server) sHandler(w http.ResponseWriter, r *http.Request) {
127127
http.Redirect(w, r, "/404.html", http.StatusTemporaryRedirect)
128128
}
129129
}()
130-
alias := strings.TrimPrefix(r.URL.Path, conf.S.Prefix)
130+
alias := strings.TrimSuffix(strings.TrimPrefix(r.URL.Path, conf.S.Prefix), "/")
131131
if alias == "" {
132132
err = s.stats(ctx, w)
133133
return

0 commit comments

Comments
 (0)