fix static match / without webroot defined

This commit is contained in:
Umputun 2021-06-08 03:48:37 -05:00
parent 3fb723c8b9
commit 247cf13016

View File

@ -362,8 +362,9 @@ func (s *Service) extendMapper(m URLMapper) URLMapper {
// static match without assets defined defaulted to src:dst/
if m.MatchType == MTStatic && m.AssetsWebRoot == "" && m.AssetsLocation == "" {
if src != "/" {
m.AssetsWebRoot = strings.TrimSuffix(src, "/")
m.AssetsWebRoot = src
if m.AssetsWebRoot != "/" {
m.AssetsWebRoot = strings.TrimSuffix(m.AssetsWebRoot, "/")
}
m.AssetsLocation = strings.TrimSuffix(m.Dst, "/") + "/"
}