Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions core/services/obs/src/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@ impl Builder for ObsBuilder {

read_with_if_match: true,
read_with_if_none_match: true,
read_with_if_modified_since: true,
read_with_if_unmodified_since: true,

write: true,
write_can_empty: true,
Expand Down
10 changes: 10 additions & 0 deletions core/services/obs/src/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ use http::header::CONTENT_DISPOSITION;
use http::header::CONTENT_LENGTH;
use http::header::CONTENT_TYPE;
use http::header::IF_MATCH;
use http::header::IF_MODIFIED_SINCE;
use http::header::IF_NONE_MATCH;
use http::header::IF_UNMODIFIED_SINCE;
use opendal_core::raw::*;
use opendal_core::*;
use reqsign_core::Signer;
Expand Down Expand Up @@ -125,6 +127,14 @@ impl ObsCore {
req = req.header(IF_NONE_MATCH, if_none_match);
}

if let Some(if_modified_since) = args.if_modified_since() {
req = req.header(IF_MODIFIED_SINCE, if_modified_since.format_http_date());
}

if let Some(if_unmodified_since) = args.if_unmodified_since() {
req = req.header(IF_UNMODIFIED_SINCE, if_unmodified_since.format_http_date());
}

let req = req
.extension(Operation::Read)
.body(Buffer::new())
Expand Down
Loading