summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/fileserver
diff options
context:
space:
mode:
authorMatthew Holt <mholt@users.noreply.github.com>2021-03-01 13:49:13 -0700
committerMatthew Holt <mholt@users.noreply.github.com>2021-03-01 13:49:13 -0700
commit5bf0a55df499e189424103d87d93960395d3172f (patch)
treecf369a63dc234e3d798ce2c3cd677a367b231249 /modules/caddyhttp/fileserver
parentec309c6d52fdfce0431a1303a49f28c3f546176a (diff)
fileserver: Don't replace in request paths (fix #4027)
Diffstat (limited to 'modules/caddyhttp/fileserver')
-rw-r--r--modules/caddyhttp/fileserver/staticfiles.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/modules/caddyhttp/fileserver/staticfiles.go b/modules/caddyhttp/fileserver/staticfiles.go
index daf4b54..e809f49 100644
--- a/modules/caddyhttp/fileserver/staticfiles.go
+++ b/modules/caddyhttp/fileserver/staticfiles.go
@@ -138,12 +138,11 @@ func (fsrv *FileServer) ServeHTTP(w http.ResponseWriter, r *http.Request, next c
filesToHide := fsrv.transformHidePaths(repl)
root := repl.ReplaceAll(fsrv.Root, ".")
- suffix := repl.ReplaceAll(r.URL.Path, "")
- filename := sanitizedPathJoin(root, suffix)
+ filename := sanitizedPathJoin(root, r.URL.Path)
fsrv.logger.Debug("sanitized path join",
zap.String("site_root", root),
- zap.String("request_path", suffix),
+ zap.String("request_path", r.URL.Path),
zap.String("result", filename))
// get information about the file