mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-28 16:07:05 +00:00
test:get_object
This commit is contained in:
@@ -155,11 +155,16 @@ impl S3 for FS {
|
||||
.await
|
||||
);
|
||||
|
||||
// let body = bytes_stream(reader.stream, 100);
|
||||
let info = reader.object_info;
|
||||
|
||||
let content_type = try_!(ContentType::from_str("application/x-msdownload"));
|
||||
let last_modified = Timestamp::from(info.mod_time);
|
||||
|
||||
let output = GetObjectOutput {
|
||||
body: Some(reader.stream),
|
||||
content_length: Some(reader.object_info.size as i64),
|
||||
content_length: Some(info.size as i64),
|
||||
last_modified: Some(last_modified),
|
||||
content_type: Some(content_type),
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
@@ -208,11 +213,12 @@ impl S3 for FS {
|
||||
debug!("info {:?}", info);
|
||||
|
||||
let content_type = try_!(ContentType::from_str("application/x-msdownload"));
|
||||
let last_modified = Timestamp::from(info.mod_time);
|
||||
|
||||
let output = HeadObjectOutput {
|
||||
content_length: Some(try_!(i64::try_from(info.size))),
|
||||
content_type: Some(content_type),
|
||||
last_modified: Some(info.mod_time.into()),
|
||||
last_modified: Some(last_modified),
|
||||
// metadata: object_metadata,
|
||||
..Default::default()
|
||||
};
|
||||
@@ -268,6 +274,8 @@ impl S3 for FS {
|
||||
..
|
||||
} = input;
|
||||
|
||||
debug!("put_object metadata {:?}", metadata);
|
||||
|
||||
let Some(body) = body else { return Err(s3_error!(IncompleteBody)) };
|
||||
|
||||
let Some(content_length) = content_length else { return Err(s3_error!(IncompleteBody)) };
|
||||
|
||||
Reference in New Issue
Block a user