From 65fa394f98bcc6fc5dd838726c443ff008a067c4 Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Sat, 5 Aug 2017 10:29:09 +0100 Subject: [PATCH] Remove useless baseURL --- cmd/webdav/main.go | 1 - webdav.go | 6 +----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/cmd/webdav/main.go b/cmd/webdav/main.go index 38e3b38..a5fd3a3 100644 --- a/cmd/webdav/main.go +++ b/cmd/webdav/main.go @@ -161,7 +161,6 @@ func parseConfig() *cfg { port: data.Port, auth: map[string]string{}, webdav: &webdav.Config{ - BaseURL: "", User: &webdav.User{ Scope: data.Scope, Modify: data.Modify, diff --git a/webdav.go b/webdav.go index 380b0ad..fc09fa1 100644 --- a/webdav.go +++ b/webdav.go @@ -12,8 +12,7 @@ import ( // Config is the configuration of a WebDAV instance. type Config struct { *User - BaseURL string - Users map[string]*User + Users map[string]*User } // ServeHTTP determines if the request is for this plugin, and if all prerequisites are met. @@ -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. if !u.Allowed(r.URL.Path) { w.WriteHeader(http.StatusForbidden)