Skip to content

Commit

Permalink
fix: convert '\' to '/' on windows (minio#16852)
Browse files Browse the repository at this point in the history
  • Loading branch information
harshavardhana authored Mar 20, 2023
1 parent 67f4ba1 commit 8d6558b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/generic-handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"net"
"net/http"
"path"
"path/filepath"
"runtime/debug"
"strings"
"sync/atomic"
Expand Down Expand Up @@ -349,7 +350,7 @@ func hasBadHost(host string) error {
// Check if the incoming path has bad path components,
// such as ".." and "."
func hasBadPathComponent(path string) bool {
path = strings.TrimSpace(path)
path = filepath.ToSlash(strings.TrimSpace(path)) // For windows '\' must be converted to '/'
for _, p := range strings.Split(path, SlashSeparator) {
switch strings.TrimSpace(p) {
case dotdotComponent:
Expand Down

0 comments on commit 8d6558b

Please sign in to comment.