From 2b0384e3a83410dbddfe8196c2a18519ad81db4c Mon Sep 17 00:00:00 2001 From: Giovanni Harting <539@idlegandalf.com> Date: Fri, 3 Mar 2023 20:34:30 +0100 Subject: [PATCH] test different path param --- main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 5deebe7..22d301d 100644 --- a/main.go +++ b/main.go @@ -1063,12 +1063,12 @@ func getSiteMapIndex(c *gin.Context) { } func getSiteMap(c *gin.Context) { - if c.Param("num") == "" { + if c.Param("id") == "" { _ = c.AbortWithError(http.StatusBadRequest, fmt.Errorf("no index specified")) return } - id, err := strconv.Atoi(c.Param("num")) + id, err := strconv.Atoi(c.Param("id")) if err != nil { _ = c.AbortWithError(http.StatusInternalServerError, err) return @@ -1245,7 +1245,7 @@ func main() { r.GET("/matches", getMatches) r.GET("/matches/next/:time", getMatches) r.GET("/sitemap_index.xml", getSiteMapIndex) - r.GET("/sitemap:num.xml", getSiteMap) + r.GET("/sitemap/:id.xml", getSiteMap) log.Info("Start listening...")