Closed
Description
Cross posted from #2767
package main
import "github.com/gin-gonic/gin"
func main() {
r := gin.Default()
r.GET("/aa/:customer", newHandler("/aa/:customer"))
r.GET("/aa/:customer/files/:file", newHandler("/aa/:customer/files/:file"))
r.Run()
}
func newHandler(t string) func(c *gin.Context) {
return func(c *gin.Context) {
c.JSON(200, gin.H{
"message": t,
})
}
}
For the above code example, the request results are:
/aa/1/files/aa => /aa/:customer/files/:file
/aa/1/files/ => /aa/:customer
/aa/1/files => 404
/aa/1 => /aa/:customer
Activity
appleboy commentedon Oct 23, 2021
See solution #2897 already merged in the master branch.