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) {
|
||||
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...")
|
||||
|
||||
|
Reference in New Issue
Block a user