Add some defaults

pull/144/head
Henrique Dias 2017-06-25 21:14:07 +01:00
parent 1354878838
commit 1bf6cafaac
No known key found for this signature in database
GPG Key ID: 936F5EB68D786730
1 changed files with 10 additions and 0 deletions

View File

@ -75,6 +75,16 @@ func parse(c *caddy.Controller) ([]*filemanager.FileManager, error) {
name = ""
)
caddyConf := httpserver.GetConfig(c)
m.PrefixURL = strings.TrimSuffix(caddyConf.Addr.Path, "/")
m.Commands = []string{"git", "svn", "hg"}
m.Rules = append(m.Rules, &filemanager.Rule{
Regex: true,
Allow: false,
Regexp: regexp.MustCompile("\\/\\..+"),
})
// Get the baseURL
args := c.RemainingArgs()