From 582f041748b62bfa79b9ee8416299f5429b38791 Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Wed, 7 Aug 2019 10:26:36 -0400 Subject: [PATCH] Return plainer message on coll .txt post 404 Ref T493 --- posts.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/posts.go b/posts.go index 3811253..ca1be25 100644 --- a/posts.go +++ b/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)) if !postFound { 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 != "" { fmt.Fprintf(w, "# %s\n\n", p.Title.String) }