From ed0dc6f73c91d22bf869b09c0e62ea4bf17524b9 Mon Sep 17 00:00:00 2001 From: geetanshjuneja Date: Sun, 5 Jan 2025 16:02:32 +0000 Subject: [PATCH] fix --- core/src/services/cos/core.rs | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/core/src/services/cos/core.rs b/core/src/services/cos/core.rs index f4dd9e36bd37..d80635a7f6b5 100644 --- a/core/src/services/cos/core.rs +++ b/core/src/services/cos/core.rs @@ -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) } } @@ -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) } }