Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
geetanshjuneja committed Jan 5, 2025
1 parent 36ea40a commit ed0dc6f
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions core/src/services/cos/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,14 +186,14 @@ impl CosCore {

// Set user metadata headers.
if let Some(user_metadata) = args.user_metadata() {
// before insert user defined metadata header, add prefix to the header name
if !self.check_user_metadata_key(key) {
return Err(Error::new(
ErrorKind::Unsupported,
"the format of the user metadata key is invalid, please refer the document",
));
}
for (key, value) in user_metadata {
// before insert user defined metadata header, add prefix to the header name
if !self.check_user_metadata_key(key) {
return Err(Error::new(
ErrorKind::Unsupported,
"the format of the user metadata key is invalid, please refer the document",
));
}
req = req.header(format!("x-cos-meta-{key}"), value)
}
}
Expand Down Expand Up @@ -361,14 +361,14 @@ impl CosCore {

// Set user metadata headers.
if let Some(user_metadata) = args.user_metadata() {
// before insert user defined metadata header, add prefix to the header name
if !self.check_user_metadata_key(key) {
return Err(Error::new(
ErrorKind::Unsupported,
"the format of the user metadata key is invalid, please refer the document",
));
}
for (key, value) in user_metadata {
// before insert user defined metadata header, add prefix to the header name
if !self.check_user_metadata_key(key) {
return Err(Error::new(
ErrorKind::Unsupported,
"the format of the user metadata key is invalid, please refer the document",
));
}
req = req.header(format!("x-cos-meta-{key}"), value)
}
}
Expand Down

0 comments on commit ed0dc6f

Please sign in to comment.