fix: hugo full path in URL #288

This commit is contained in:
Henrique Dias 2017-12-27 15:53:38 +00:00
parent b1c36ec71f
commit 2beb0b3a03

View File

@ -84,7 +84,8 @@ func (h Hugo) Hook(c *fm.Context, w http.ResponseWriter, r *http.Request) (int,
return http.StatusForbidden, nil
}
filename := filepath.Join(c.User.Scope, r.URL.Path)
filename := filepath.Clean(r.URL.Path)
filename = strings.TrimPrefix(filename, string(filepath.Separator))
archetype := r.Header.Get("archetype")
ext := filepath.Ext(filename)