From 56cb3f26f876543cd7699422855b32542e0a7e1c Mon Sep 17 00:00:00 2001 From: gavinhgchen Date: Wed, 20 Jul 2022 19:22:02 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E7=94=A8SetDestDomain?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E5=9F=9F=E5=90=8D=E5=90=8E=E7=94=9F=E6=88=90?= =?UTF-8?q?=E9=A2=84=E7=AD=BE=E5=90=8Durl(GeneratePresignedUrl)=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/op/object_op.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/op/object_op.cpp b/src/op/object_op.cpp index 8d93c87..0ba715e 100644 --- a/src/op/object_op.cpp +++ b/src/op/object_op.cpp @@ -1649,8 +1649,15 @@ void ObjectOp::FillCopyTask(const std::string& upload_id, std::string ObjectOp::GeneratePresignedUrl(const GeneratePresignedUrlReq& req) { std::string auth_str = ""; - std::string host = CosSysConfig::GetHost(GetAppId(), m_config->GetRegion(), + + std::string host; + if (!CosSysConfig::GetDestDomain().empty()) { + host = CosSysConfig::GetDestDomain(); + } else { + host = CosSysConfig::GetHost(GetAppId(), m_config->GetRegion(), req.GetBucketName()); + } + std::map headers; if (req.SignHeaderHost()) { headers["Host"] = host;