Skip to content

Commit

Permalink
解决用SetDestDomain设置域名后生成预签名url(GeneratePresignedUrl)异常的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
gavinhgchen committed Jul 20, 2022
1 parent 995a7f7 commit 56cb3f2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/op/object_op.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::string, std::string> headers;
if (req.SignHeaderHost()) {
headers["Host"] = host;
Expand Down

0 comments on commit 56cb3f2

Please sign in to comment.