test different path param
This commit is contained in:
6
main.go
6
main.go
@@ -1063,12 +1063,12 @@ func getSiteMapIndex(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func getSiteMap(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"))
|
_ = c.AbortWithError(http.StatusBadRequest, fmt.Errorf("no index specified"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
id, err := strconv.Atoi(c.Param("num"))
|
id, err := strconv.Atoi(c.Param("id"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
_ = c.AbortWithError(http.StatusInternalServerError, err)
|
_ = c.AbortWithError(http.StatusInternalServerError, err)
|
||||||
return
|
return
|
||||||
@@ -1245,7 +1245,7 @@ func main() {
|
|||||||
r.GET("/matches", getMatches)
|
r.GET("/matches", getMatches)
|
||||||
r.GET("/matches/next/:time", getMatches)
|
r.GET("/matches/next/:time", getMatches)
|
||||||
r.GET("/sitemap_index.xml", getSiteMapIndex)
|
r.GET("/sitemap_index.xml", getSiteMapIndex)
|
||||||
r.GET("/sitemap:num.xml", getSiteMap)
|
r.GET("/sitemap/:id.xml", getSiteMap)
|
||||||
|
|
||||||
log.Info("Start listening...")
|
log.Info("Start listening...")
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user