aboutsummaryrefslogtreecommitdiff
path: root/weed/s3api/s3api_object_handlers_put.go
diff options
context:
space:
mode:
authorChris Lu <chrislusf@users.noreply.github.com>2025-12-14 11:18:23 -0800
committerGitHub <noreply@github.com>2025-12-14 11:18:23 -0800
commita77674ead3c5f1f9bd21a46f6f90019f178c6a70 (patch)
tree5e99297ace743826b6936d011c32ffa256d95635 /weed/s3api/s3api_object_handlers_put.go
parenteb860752e6c0a86131e39d648f0a64364408ab93 (diff)
downloadseaweedfs-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/s3api_object_handlers_put.go')
-rw-r--r--weed/s3api/s3api_object_handlers_put.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/weed/s3api/s3api_object_handlers_put.go b/weed/s3api/s3api_object_handlers_put.go
index 3da9047ac..7c73f4ce0 100644
--- a/weed/s3api/s3api_object_handlers_put.go
+++ b/weed/s3api/s3api_object_handlers_put.go
@@ -9,7 +9,7 @@ import (
"io"
"net/http"
"net/url"
- "path/filepath"
+ "path"
"strconv"
"strings"
"time"
@@ -491,7 +491,7 @@ func (s3a *S3ApiServer) putToFiler(r *http.Request, filePath string, dataReader
// Create entry
entry := &filer_pb.Entry{
- Name: filepath.Base(filePath),
+ Name: path.Base(filePath),
IsDirectory: false,
Attributes: &filer_pb.FuseAttributes{
Crtime: now.Unix(),
@@ -611,10 +611,10 @@ func (s3a *S3ApiServer) putToFiler(r *http.Request, filePath string, dataReader
// Use context.Background() to ensure metadata save completes even if HTTP request is cancelled
// This matches the chunk upload behavior and prevents orphaned chunks
glog.V(3).Infof("putToFiler: About to create entry - dir=%s, name=%s, chunks=%d, extended keys=%d",
- filepath.Dir(filePath), filepath.Base(filePath), len(entry.Chunks), len(entry.Extended))
+ path.Dir(filePath), path.Base(filePath), len(entry.Chunks), len(entry.Extended))
createErr := s3a.WithFilerClient(false, func(client filer_pb.SeaweedFilerClient) error {
req := &filer_pb.CreateEntryRequest{
- Directory: filepath.Dir(filePath),
+ Directory: path.Dir(filePath),
Entry: entry,
}
glog.V(3).Infof("putToFiler: Calling CreateEntry for %s", filePath)