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:
commit
2c99626eb0
|
@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue