Merge pull request #10 from tailscale-dev/Xe/fix-404-double-render

cmd/web: fix double HTML render when passing a trailing slash
This commit is contained in:
Xe Iaso 2023-08-02 14:40:08 -04:00 committed by GitHub
commit 2c99626eb0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -544,6 +544,8 @@ WHERE p.id = ?1`
w.WriteHeader(http.StatusOK) w.WriteHeader(http.StatusOK)
fmt.Fprint(w, data) fmt.Fprint(w, data)
return
case "":
// view markdown file with a fancy HTML rendering step // view markdown file with a fancy HTML rendering step
case "md": case "md":
if lang != "Markdown" { if lang != "Markdown" {
@ -576,6 +578,7 @@ WHERE p.id = ?1`
// otherwise, throw a 404 // otherwise, throw a 404
default: default:
s.NotFound(w, r) s.NotFound(w, r)
return
} }
} }