fix web dav URL

This commit is contained in:
Henrique Dias
2016-11-06 13:17:07 +00:00
parent 41e7894425
commit eeeb1ce0fd
3 changed files with 13 additions and 8 deletions

View File

@@ -64,7 +64,7 @@ func (f FileManager) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, err
}
// Checks if the request URL is for the WebDav server
if strings.HasPrefix(r.URL.Path, c.WebDavURL) {
if httpserver.Path(r.URL.Path).Matches(c.WebDavURL) {
// Checks for user permissions relatively to this PATH
if !user.Allowed(strings.TrimPrefix(r.URL.Path, c.WebDavURL)) {
return http.StatusForbidden, nil