From f2380057d6558b4a5d043c31693ca0689a14bf1f Mon Sep 17 00:00:00 2001 From: Rawley Fowler Date: Sun, 8 May 2022 19:55:32 -0600 Subject: [PATCH] fixed weird xml string --- controllers/blog.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/controllers/blog.go b/controllers/blog.go index 693f079..26cc3f6 100644 --- a/controllers/blog.go +++ b/controllers/blog.go @@ -77,12 +77,11 @@ func (bc *BlogController) RSSFeed(c *gin.Context) { c.HTML(http.StatusInternalServerError, "internal_server_error", &gin.H{}) return } - c.Header("Content-Type", "text/xml") var rawXml bytes.Buffer err = t.Execute(&rawXml, posts) if err != nil { c.HTML(http.StatusInternalServerError, "internal_server_error", &gin.H{}) return } - c.String(http.StatusOK, strings.Replace(rawXml.String(), "&", "&", -1), &gin.H{}) + c.Data(http.StatusOK, "text/xml", []byte(strings.Replace("&", "&", rawXml.String(), -1))) }