diff options
| author | Konstantin Lebedev <9497591+kmlebedev@users.noreply.github.com> | 2022-06-07 14:43:10 +0500 |
|---|---|---|
| committer | Konstantin Lebedev <9497591+kmlebedev@users.noreply.github.com> | 2022-06-07 14:43:10 +0500 |
| commit | c07820178f492c9f344bfce2d929c646dcdc7638 (patch) | |
| tree | 37ae966e321bf1dda67eee7ffe75545afb0008f6 /weed/s3api/s3api_object_handlers.go | |
| parent | b86628f85d7647251af1b43e2397ab7e9bfbc0bd (diff) | |
| download | seaweedfs-c07820178f492c9f344bfce2d929c646dcdc7638.tar.xz seaweedfs-c07820178f492c9f344bfce2d929c646dcdc7638.zip | |
fix s3 tests
bucket_list_delimiter_prefix
bucket_list_delimiter_prefix_underscore
bucket_list_delimiter_prefix_ends_with_delimiter
Diffstat (limited to 'weed/s3api/s3api_object_handlers.go')
| -rw-r--r-- | weed/s3api/s3api_object_handlers.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/weed/s3api/s3api_object_handlers.go b/weed/s3api/s3api_object_handlers.go index 5e34803cc..84ed1c92b 100644 --- a/weed/s3api/s3api_object_handlers.go +++ b/weed/s3api/s3api_object_handlers.go @@ -92,16 +92,20 @@ func (s3a *S3ApiServer) PutObjectHandler(w http.ResponseWriter, r *http.Request) } defer dataReader.Close() + objectContentType := r.Header.Get("Content-Type") if strings.HasSuffix(object, "/") { if err := s3a.mkdir(s3a.option.BucketsPath, bucket+strings.TrimSuffix(object, "/"), func(entry *filer_pb.Entry) { - entry.Attributes.Mime = r.Header.Get("Content-Type") + if objectContentType == "" { + objectContentType = "httpd/unix-directory" + } + entry.Attributes.Mime = objectContentType }); err != nil { s3err.WriteErrorResponse(w, r, s3err.ErrInternalError) return } } else { uploadUrl := s3a.toFilerUrl(bucket, object) - if r.Header.Get("Content-Type") == "" { + if objectContentType == "" { dataReader = mimeDetect(r, dataReader) } |
