Return plainer message on coll .txt post 404
Ref T493
This commit is contained in:
parent
35906118d0
commit
582f041748
4
posts.go
4
posts.go
@ -1344,8 +1344,10 @@ Are you sure it was ever here?`,
|
|||||||
w.Header().Set("Content-Type", fmt.Sprintf("%s; charset=utf-8", contentType))
|
w.Header().Set("Content-Type", fmt.Sprintf("%s; charset=utf-8", contentType))
|
||||||
if !postFound {
|
if !postFound {
|
||||||
w.WriteHeader(http.StatusNotFound)
|
w.WriteHeader(http.StatusNotFound)
|
||||||
|
fmt.Fprintf(w, "Post not found.")
|
||||||
|
// TODO: return error instead, so status is correctly reflected in logs
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
if isMarkdown && p.Title.String != "" {
|
if isMarkdown && p.Title.String != "" {
|
||||||
fmt.Fprintf(w, "# %s\n\n", p.Title.String)
|
fmt.Fprintf(w, "# %s\n\n", p.Title.String)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user