1
0
Fork 0

In Article HTTP handler a loging for web.GetArticle() was changed.

This commit is contained in:
Alexander Andreev 2023-09-24 20:00:49 +04:00
parent 48e7a86312
commit fe87114fe0
Signed by: Arav
GPG Key ID: D22A817D95815393
1 changed files with 3 additions and 3 deletions

View File

@ -103,9 +103,9 @@ func (h *Handlers) About(w http.ResponseWriter, r *http.Request) {
func (h *Handlers) Article(w http.ResponseWriter, r *http.Request) {
name := r.URL.Path[strings.LastIndex(r.URL.Path, "/")+1:]
artcl, err := web.GetArticle(name)
if err != nil {
http.Error(w, err.Error(), http.StatusNotFound)
artcl := web.GetArticle(name)
if artcl == nil {
http.Error(w, "an article doesn't exist", http.StatusNotFound)
return
}