summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/matchers.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/caddyhttp/matchers.go')
-rw-r--r--modules/caddyhttp/matchers.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/caddyhttp/matchers.go b/modules/caddyhttp/matchers.go
index f5f9a0f..fb84875 100644
--- a/modules/caddyhttp/matchers.go
+++ b/modules/caddyhttp/matchers.go
@@ -25,6 +25,7 @@ import (
"path"
"reflect"
"regexp"
+ "runtime"
"sort"
"strconv"
"strings"
@@ -395,7 +396,9 @@ func (m MatchPath) Match(r *http.Request) bool {
// security risk (cry) if PHP files end up being served
// as static files, exposing the source code, instead of
// being matched by *.php to be treated as PHP scripts.
- reqPath = strings.TrimRight(reqPath, ". ")
+ if runtime.GOOS == "windows" { // issue #5613
+ reqPath = strings.TrimRight(reqPath, ". ")
+ }
repl := r.Context().Value(caddy.ReplacerCtxKey).(*caddy.Replacer)