mirror of
https://github.com/coaidev/coai.git
synced 2025-05-19 21:10:18 +09:00
feat: use builtin handler instead of redirect
This commit is contained in:
parent
be2bd3da35
commit
fe6c9b0d14
@ -105,7 +105,9 @@ func RegisterStaticRoute(engine *gin.Engine) {
|
||||
for _, route := range redirectRoutes {
|
||||
engine.Any(fmt.Sprintf("%s/*path", route), func(c *gin.Context) {
|
||||
path := c.Param("path")
|
||||
c.Redirect(301, fmt.Sprintf("/api%s/%s", route, path))
|
||||
|
||||
c.Request.URL.Path = path
|
||||
engine.HandleContext(c)
|
||||
})
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user