Skip to content

Commit 8161e33

Browse files
committed
deal with unslashed static
1 parent 744c574 commit 8161e33

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

serve/main.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ func main() {
4646
func mux(static string, score ScoreHandler) *httprouter.Router {
4747
r := httprouter.New()
4848
if static != "" {
49+
if !strings.HasSuffix(static, "/") {
50+
static += "/"
51+
}
4952
r.GET("/", func(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
5053
http.ServeFile(w, r, static+"index.html")
5154
})

0 commit comments

Comments
 (0)