Add some defaults

Former-commit-id: f89c857e14d008bc896762692673d4642fc8042f [formerly fcede1def5b083a7b15380f584088364fd8319a3] [formerly ba4a56156d493095ae320eee4a06d54bfe032035 [formerly 1bf6cafaac]]
Former-commit-id: ae7d98d77fcf5c8789bcf6e61844bf115b9cd4da [formerly 01766747a9319ad334849f5843ad2874744b83a5]
Former-commit-id: 6c7456de6ac105a8e5c8cf87565476a589953b4d
pull/726/head
Henrique Dias 2017-06-25 21:14:07 +01:00
parent 2abda6133e
commit 9946cd6a46
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()