소스 검색

Merge pull request #254 from bfosberry/fixing-static-bug

Fixing bug with static pathing
Manu Mtz.-Almeida 10 년 전
부모
커밋
408108f4e7
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 3
      routergroup.go

+ 3 - 3
routergroup.go

@@ -111,11 +111,11 @@ func (group *RouterGroup) UNLINK(relativePath string, handlers ...HandlerFunc) {
 func (group *RouterGroup) Static(relativePath, root string) {
 func (group *RouterGroup) Static(relativePath, root string) {
 	absolutePath := group.calculateAbsolutePath(relativePath)
 	absolutePath := group.calculateAbsolutePath(relativePath)
 	handler := group.createStaticHandler(absolutePath, root)
 	handler := group.createStaticHandler(absolutePath, root)
-	absolutePath = path.Join(absolutePath, "/*filepath")
+	relativePath = path.Join(relativePath, "/*filepath")
 
 
 	// Register GET and HEAD handlers
 	// 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) {
 func (group *RouterGroup) createStaticHandler(absolutePath, root string) func(*Context) {