Skip to content

Commit

Permalink
chore: some docs fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Frank-III committed Dec 5, 2024
1 parent c3bedc6 commit 92d93a0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
8 changes: 4 additions & 4 deletions core/src/services/s3/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -449,14 +449,14 @@ impl S3Core {
req = req.header(CONTENT_TYPE, mime)
}

if let Some(encoding) = args.content_encoding() {
req = req.header(CONTENT_ENCODING, encoding);
}

if let Some(pos) = args.content_disposition() {
req = req.header(CONTENT_DISPOSITION, pos)
}

if let Some(encoding) = args.content_encoding() {
req = req.header(CONTENT_ENCODING, encoding);
}

if let Some(cache_control) = args.cache_control() {
req = req.header(CACHE_CONTROL, cache_control)
}
Expand Down
11 changes: 7 additions & 4 deletions core/src/types/operator/operator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1437,16 +1437,19 @@ impl Operator {
/// # use opendal::Operator;
/// use bytes::Bytes;
/// # async fn test(op: Operator) -> Result<()> {
/// let _ = op
/// .write_with("path/to/file", bs)
/// .content_encoding("br")
/// .await?;
/// let bs = b"hello, world!".to_vec();
/// let _ = op
/// .write_with("path/to/file", bs)
/// .content_encoding("br")
/// .await?;
/// # Ok(())
/// # }
/// ```
///
/// ## `if_none_match`
///
/// Sets an `if none match` condition with specified ETag for this write request.
///
/// ### Capability
///
/// Check [`Capability::write_with_if_none_match`] before using this feature.
Expand Down
2 changes: 1 addition & 1 deletion core/tests/behavior/async_write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ pub async fn test_write_with_content_encoding(op: Operator) -> Result<()> {
return Ok(());
}

let (path, content, size) = TEST_FIXTURE.new_file(op.clone());
let (path, content, _) = TEST_FIXTURE.new_file(op.clone());

let target_content_encoding = "gzip";
op.write_with(&path, content)
Expand Down

0 comments on commit 92d93a0

Please sign in to comment.