Skip to content

Commit

Permalink
fix #8
Browse files Browse the repository at this point in the history
  • Loading branch information
codeskyblue committed Dec 22, 2016
1 parent 7e1387a commit 9af2b5b
Show file tree
Hide file tree
Showing 152 changed files with 11,038 additions and 25,581 deletions.
24 changes: 23 additions & 1 deletion Godeps/Godeps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions httpstaticserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,6 @@ func (c *AccessConf) canUpload(r *http.Request) bool {
return c.Upload
}
userInfo := val.(*UserInfo)
log.Println(userInfo)
for _, rule := range c.Users {
if rule.Email == userInfo.Email {
return rule.Upload
Expand Down Expand Up @@ -537,7 +536,13 @@ func (s *HTTPStaticServer) defaultAccessConf() AccessConf {
}

func (s *HTTPStaticServer) readAccessConf(requestPath string) (ac AccessConf) {
ac = s.defaultAccessConf()
requestPath = filepath.Clean(requestPath)
if requestPath == "/" || requestPath == "" || requestPath == "." {
ac = s.defaultAccessConf()
} else {
parentPath := filepath.Dir(requestPath)
ac = s.readAccessConf(parentPath)
}
relPath := filepath.Join(s.Root, requestPath)
if isFile(relPath) {
relPath = filepath.Dir(relPath)
Expand Down
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ func main() {
data, _ := yaml.Marshal(gcfg)
fmt.Printf("--- config ---\n%s\n", string(data))
}
log.SetFlags(log.Lshortfile | log.LstdFlags)

ss := NewHTTPStaticServer(gcfg.Root)
ss.Theme = gcfg.Theme
Expand Down
Empty file.
58 changes: 0 additions & 58 deletions vendor/github.com/DHowett/go-plist/LICENSE

This file was deleted.

19 changes: 0 additions & 19 deletions vendor/github.com/DHowett/go-plist/README.md

This file was deleted.

Loading

0 comments on commit 9af2b5b

Please sign in to comment.