From f172f1bca1e739951f1c3b0969cc4d6dc31bd9a7 Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Sun, 12 May 2019 19:00:58 +0100 Subject: [PATCH] refactor: cleanup License: MIT Signed-off-by: Henrique Dias --- user.go | 9 +++++++++ webdav.go | 9 --------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/user.go b/user.go index 73d9c91..3d72d9d 100644 --- a/user.go +++ b/user.go @@ -1,11 +1,20 @@ package webdav import ( + "regexp" "strings" "golang.org/x/net/webdav" ) +// Rule is a dissalow/allow rule. +type Rule struct { + Regex bool + Allow bool + Path string + Regexp *regexp.Regexp +} + // User contains the settings of each user. type User struct { Username string diff --git a/webdav.go b/webdav.go index e9a2dbe..a01a6f7 100644 --- a/webdav.go +++ b/webdav.go @@ -4,7 +4,6 @@ import ( "context" "log" "net/http" - "regexp" ) // Config is the configuration of a WebDAV instance. @@ -84,14 +83,6 @@ func (c *Config) ServeHTTP(w http.ResponseWriter, r *http.Request) { u.Handler.ServeHTTP(w, r) } -// Rule is a dissalow/allow rule. -type Rule struct { - Regex bool - Allow bool - Path string - Regexp *regexp.Regexp -} - // responseWriterNoBody is a wrapper used to suprress the body of the response // to a request. Mainly used for HEAD requests. type responseWriterNoBody struct {