summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/fileserver/browse.go
diff options
context:
space:
mode:
authorMatthew Holt <mholt@users.noreply.github.com>2019-06-14 11:58:28 -0600
committerMatthew Holt <mholt@users.noreply.github.com>2019-06-14 11:58:28 -0600
commit5137859e47678aae81e178ca7d164f9e2b4e3121 (patch)
treef0e5cb9b9a4ad5dc03b53127fcea2a536bd6ee27 /modules/caddyhttp/fileserver/browse.go
parentb8e7453fef3dac6036403bc384eec96becff5114 (diff)
Rename caddy2 -> caddy
Removes the version from the package name
Diffstat (limited to 'modules/caddyhttp/fileserver/browse.go')
-rw-r--r--modules/caddyhttp/fileserver/browse.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/caddyhttp/fileserver/browse.go b/modules/caddyhttp/fileserver/browse.go
index d86bc64..1329541 100644
--- a/modules/caddyhttp/fileserver/browse.go
+++ b/modules/caddyhttp/fileserver/browse.go
@@ -9,8 +9,8 @@ import (
"path"
"strings"
- "github.com/caddyserver/caddy2"
- "github.com/caddyserver/caddy2/modules/caddyhttp"
+ "github.com/caddyserver/caddy"
+ "github.com/caddyserver/caddy/modules/caddyhttp"
)
// Browse configures directory browsing.
@@ -37,7 +37,7 @@ func (fsrv *FileServer) serveBrowse(dirPath string, w http.ResponseWriter, r *ht
}
defer dir.Close()
- repl := r.Context().Value(caddy2.ReplacerCtxKey).(caddy2.Replacer)
+ repl := r.Context().Value(caddy.ReplacerCtxKey).(caddy.Replacer)
// calling path.Clean here prevents weird breadcrumbs when URL paths are sketchy like /%2e%2e%2f
listing, err := fsrv.loadDirectoryContents(dir, path.Clean(r.URL.Path), repl)
@@ -71,7 +71,7 @@ func (fsrv *FileServer) serveBrowse(dirPath string, w http.ResponseWriter, r *ht
return nil
}
-func (fsrv *FileServer) loadDirectoryContents(dir *os.File, urlPath string, repl caddy2.Replacer) (browseListing, error) {
+func (fsrv *FileServer) loadDirectoryContents(dir *os.File, urlPath string, repl caddy.Replacer) (browseListing, error) {
files, err := dir.Readdir(-1)
if err != nil {
return browseListing{}, err