diff options
| author | Chris Lu <chrislusf@users.noreply.github.com> | 2025-12-14 11:18:23 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-12-14 11:18:23 -0800 |
| commit | a77674ead3c5f1f9bd21a46f6f90019f178c6a70 (patch) | |
| tree | 5e99297ace743826b6936d011c32ffa256d95635 /weed/s3api/s3_constants/header.go | |
| parent | eb860752e6c0a86131e39d648f0a64364408ab93 (diff) | |
| download | seaweedfs-a77674ead3c5f1f9bd21a46f6f90019f178c6a70.tar.xz seaweedfs-a77674ead3c5f1f9bd21a46f6f90019f178c6a70.zip | |
fix: use path instead of filepath for S3 object paths on Windows (#7739)
fix: use path instead of filepath for S3 object paths on Windows (#7733)
Diffstat (limited to 'weed/s3api/s3_constants/header.go')
| -rw-r--r-- | weed/s3api/s3_constants/header.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/weed/s3api/s3_constants/header.go b/weed/s3api/s3_constants/header.go index b7e1be9e5..4b34f397e 100644 --- a/weed/s3api/s3_constants/header.go +++ b/weed/s3api/s3_constants/header.go @@ -146,7 +146,10 @@ func GetBucketAndObject(r *http.Request) (bucket, object string) { // NormalizeObjectKey ensures the object key has a leading slash and no duplicate slashes. // This normalizes keys from various sources (URL path, form values, etc.) to a consistent format. +// It also converts Windows-style backslashes to forward slashes for cross-platform compatibility. func NormalizeObjectKey(object string) string { + // Convert Windows-style backslashes to forward slashes + object = strings.ReplaceAll(object, "\\", "/") object = removeDuplicateSlashes(object) if !strings.HasPrefix(object, "/") { object = "/" + object |
