return 404 is no sitemap exists

This commit is contained in:
2023-03-03 20:47:00 +01:00
parent 762c137de1
commit 84f8f866b0

View File

@@ -1080,6 +1080,11 @@ func getSiteMap(c *gin.Context) {
return
}
if res == nil {
_ = c.AbortWithError(http.StatusNotFound, fmt.Errorf("sitemap does not exist"))
return
}
c.Data(http.StatusOK, "application/xml", res)
}