clean AbsoluteURL
parent
7ed515dba8
commit
aa79b076ae
|
@ -76,8 +76,9 @@ func Parse(c *caddy.Controller) ([]Config, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
caddyConf := httpserver.GetConfig(c)
|
caddyConf := httpserver.GetConfig(c)
|
||||||
cfg.AbsoluteURL = caddyConf.Addr.Path + "/" + cfg.BaseURL
|
cfg.AbsoluteURL = strings.TrimSuffix(caddyConf.Addr.Path, "/") + "/" + cfg.BaseURL
|
||||||
cfg.AbsoluteURL = strings.Replace(cfg.AbsoluteURL, "//", "/", -1)
|
cfg.AbsoluteURL = strings.Replace(cfg.AbsoluteURL, "//", "/", -1)
|
||||||
|
cfg.AbsoluteURL = strings.TrimSuffix(cfg.AbsoluteURL, "/")
|
||||||
cfg.AddrPath = strings.TrimSuffix(caddyConf.Addr.Path, "/")
|
cfg.AddrPath = strings.TrimSuffix(caddyConf.Addr.Path, "/")
|
||||||
cfg.Root = http.Dir(cfg.PathScope)
|
cfg.Root = http.Dir(cfg.PathScope)
|
||||||
if err := appendConfig(cfg); err != nil {
|
if err := appendConfig(cfg); err != nil {
|
||||||
|
|
Loading…
Reference in New Issue