Skip to content

Commit

Permalink
feat: use builtin handler instead of redirect
Browse files Browse the repository at this point in the history
zmh-program committed Mar 8, 2024
1 parent be2bd3d commit fe6c9b0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion utils/config.go
Original file line number Diff line number Diff line change
@@ -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)
})
}

0 comments on commit fe6c9b0

Please sign in to comment.