Skip to content

Commit

Permalink
short: handle trailing slash
Browse files Browse the repository at this point in the history
  • Loading branch information
changkun committed Oct 30, 2020
1 parent cae3f36 commit 370874c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion short.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ func (s *server) sHandler(w http.ResponseWriter, r *http.Request) {
http.Redirect(w, r, "/404.html", http.StatusTemporaryRedirect)
}
}()
alias := strings.TrimPrefix(r.URL.Path, conf.S.Prefix)
alias := strings.TrimSuffix(strings.TrimPrefix(r.URL.Path, conf.S.Prefix), "/")
if alias == "" {
err = s.stats(ctx, w)
return
Expand Down

0 comments on commit 370874c

Please sign in to comment.