mirror of
https://github.com/minio/minio
synced 2024-09-06 00:37:25 +00:00
fix: convert '\' to '/' on windows (#16852)
This commit is contained in:
parent
67f4ba154a
commit
8d6558b236
|
@ -22,6 +22,7 @@ import (
|
|||
"net"
|
||||
"net/http"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"runtime/debug"
|
||||
"strings"
|
||||
"sync/atomic"
|
||||
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue