Remove useless baseURL

This commit is contained in:
Henrique Dias
2017-08-05 10:29:09 +01:00
parent 26ebe92f2c
commit 65fa394f98
2 changed files with 1 additions and 6 deletions
-1
View File
@@ -161,7 +161,6 @@ func parseConfig() *cfg {
port: data.Port, port: data.Port,
auth: map[string]string{}, auth: map[string]string{},
webdav: &webdav.Config{ webdav: &webdav.Config{
BaseURL: "",
User: &webdav.User{ User: &webdav.User{
Scope: data.Scope, Scope: data.Scope,
Modify: data.Modify, Modify: data.Modify,
-4
View File
@@ -12,7 +12,6 @@ import (
// Config is the configuration of a WebDAV instance. // Config is the configuration of a WebDAV instance.
type Config struct { type Config struct {
*User *User
BaseURL string
Users map[string]*User Users map[string]*User
} }
@@ -28,9 +27,6 @@ func (c *Config) ServeHTTP(w http.ResponseWriter, r *http.Request) {
} }
} }
// Remove the BaseURL from the url path.
r.URL.Path = strings.TrimPrefix(r.URL.Path, c.BaseURL)
// Checks for user permissions relatively to this PATH. // Checks for user permissions relatively to this PATH.
if !u.Allowed(r.URL.Path) { if !u.Allowed(r.URL.Path) {
w.WriteHeader(http.StatusForbidden) w.WriteHeader(http.StatusForbidden)