|
1 |
| -// Copyright (c) 2017, Tencent Inc. |
| 1 | +// Copyright (c) 2017, Tencent Inc. |
2 | 2 | // All rights reserved.
|
3 | 3 | //
|
4 | 4 | // Author: sevenyou <[email protected]>
|
@@ -337,7 +337,11 @@ CosResult ObjectOp::HeadObject(const HeadObjectReq& req, HeadObjectResp* resp, b
|
337 | 337 | std::string host = CosSysConfig::GetHost(GetAppId(), m_config->GetRegion(),
|
338 | 338 | req.GetBucketName(),change_backup_domain);
|
339 | 339 | std::string path = req.GetPath();
|
340 |
| - return NormalAction(host, path, req, "", false, resp); |
| 340 | + CosResult result = NormalAction(host, path, req, "", false, resp); |
| 341 | + if (result.GetHttpStatus() == 404){ |
| 342 | + result.SetErrorCode("NoSuchKey"); |
| 343 | + } |
| 344 | + return result; |
341 | 345 | }
|
342 | 346 |
|
343 | 347 | CosResult ObjectOp::GetObject(const GetObjectByStreamReq& req,
|
@@ -1781,6 +1785,9 @@ void ObjectOp::FillCopyTask(const std::string& upload_id,
|
1781 | 1785 | }
|
1782 | 1786 |
|
1783 | 1787 | std::string ObjectOp::GeneratePresignedUrl(const GeneratePresignedUrlReq& req) {
|
| 1788 | + if (req.GetObjectName().empty()) { |
| 1789 | + return "ObjectName does not support empty, please check!"; |
| 1790 | + } |
1784 | 1791 | std::string auth_str = "";
|
1785 | 1792 |
|
1786 | 1793 | std::string host;
|
|
0 commit comments