mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-05-25 03:01:47 +00:00
test s3 put
This commit is contained in:
@@ -468,7 +468,7 @@ func (s3a *S3ApiServer) completeMultipartUpload(r *http.Request, input *s3.Compl
|
||||
entry.Attributes.Mime = mime
|
||||
}
|
||||
entry.Attributes.FileSize = uint64(offset)
|
||||
if s3a.option.AllowDeleteObjectsByTTL && entry.Attributes.TtlSec > 0 {
|
||||
if s3a.option.AllowDeleteObjectsByTTL {
|
||||
entry.Extended[s3_constants.SeaweedFSExpiresS3] = []byte("true")
|
||||
}
|
||||
})
|
||||
|
||||
@@ -98,12 +98,6 @@ func (fs *FilerServer) PostHandler(w http.ResponseWriter, r *http.Request, conte
|
||||
}
|
||||
return
|
||||
}
|
||||
// Disable TTL-based (creation time) deletion when S3 expiry (modification time) is enabled
|
||||
if so.TtlSeconds > 0 {
|
||||
if s3ExpiresValue := r.Header.Get(s3_constants.SeaweedFSExpiresS3); s3ExpiresValue == "true" {
|
||||
so.TtlSeconds = 0
|
||||
}
|
||||
}
|
||||
if util.FullPath(r.URL.Path).IsLongerFileName(so.MaxFileNameLength) {
|
||||
glog.V(1).InfolnCtx(ctx, "post", r.RequestURI, ": ", "entry name too long")
|
||||
w.WriteHeader(http.StatusRequestURITooLong)
|
||||
|
||||
@@ -136,8 +136,27 @@ func (fs *FilerServer) doPutAutoChunk(ctx context.Context, w http.ResponseWriter
|
||||
if err := fs.checkPermissions(ctx, r, fileName); err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
// Disable TTL-based (creation time) deletion when S3 expiry (modification time) is enabled
|
||||
soMaybeWithOutTTL := so
|
||||
if so.TtlSeconds > 0 {
|
||||
if s3ExpiresValue := r.Header.Get(s3_constants.SeaweedFSExpiresS3); s3ExpiresValue == "true" {
|
||||
soMaybeWithOutTTL = &operation.StorageOption{
|
||||
so.Replication,
|
||||
so.DiskType,
|
||||
so.Collection,
|
||||
so.DataCenter,
|
||||
so.Rack,
|
||||
so.DataNode,
|
||||
0,
|
||||
so.VolumeGrowthCount,
|
||||
so.MaxFileNameLength,
|
||||
so.Fsync,
|
||||
so.SaveInside,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fileChunks, md5Hash, chunkOffset, err, smallContent := fs.uploadRequestToChunks(ctx, w, r, r.Body, chunkSize, fileName, contentType, contentLength, so)
|
||||
fileChunks, md5Hash, chunkOffset, err, smallContent := fs.uploadRequestToChunks(ctx, w, r, r.Body, chunkSize, fileName, contentType, contentLength, soMaybeWithOutTTL)
|
||||
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
|
||||
Reference in New Issue
Block a user