added /sitemap/index and return 400 if index parsing fails
This commit is contained in:
4
main.go
4
main.go
@@ -1089,7 +1089,7 @@ func getSiteMap(c *gin.Context) {
|
|||||||
|
|
||||||
id, err := strconv.Atoi(c.Param("id"))
|
id, err := strconv.Atoi(c.Param("id"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
_ = c.AbortWithError(http.StatusInternalServerError, err)
|
_ = c.AbortWithError(http.StatusBadRequest, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1291,6 +1291,8 @@ func main() {
|
|||||||
r.GET("/matches/next/:time", getMatches)
|
r.GET("/matches/next/:time", getMatches)
|
||||||
r.GET("/sitemap.xml", getSiteMapIndex)
|
r.GET("/sitemap.xml", getSiteMapIndex)
|
||||||
r.HEAD("/sitemap.xml", getSiteMapIndex)
|
r.HEAD("/sitemap.xml", getSiteMapIndex)
|
||||||
|
r.GET("/sitemap/index", getSiteMapIndex)
|
||||||
|
r.HEAD("/sitemap/index", getSiteMapIndex)
|
||||||
r.GET("/sitemap/:id", getSiteMap)
|
r.GET("/sitemap/:id", getSiteMap)
|
||||||
r.HEAD("/sitemap/:id", getSiteMap)
|
r.HEAD("/sitemap/:id", getSiteMap)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user