mirror of
https://github.com/gin-gonic/gin.git
synced 2025-06-19 09:46:21 +08:00
Merge branch 'develop' into performance
Conflicts: context.go context_test.go gin_test.go recovery_test.go utils.go
This commit is contained in:
@ -103,11 +103,11 @@ func (group *RouterGroup) UNLINK(relativePath string, handlers ...HandlerFunc) {
|
||||
func (group *RouterGroup) Static(relativePath, root string) {
|
||||
absolutePath := group.calculateAbsolutePath(relativePath)
|
||||
handler := group.createStaticHandler(absolutePath, root)
|
||||
absolutePath = path.Join(absolutePath, "/*filepath")
|
||||
relativePath = path.Join(relativePath, "/*filepath")
|
||||
|
||||
// Register GET and HEAD handlers
|
||||
group.GET(absolutePath, handler)
|
||||
group.HEAD(absolutePath, handler)
|
||||
group.GET(relativePath, handler)
|
||||
group.HEAD(relativePath, handler)
|
||||
}
|
||||
|
||||
func (group *RouterGroup) createStaticHandler(absolutePath, root string) func(*Context) {
|
||||
|
Reference in New Issue
Block a user