Skip to content

Commit de49280

Browse files
Streamlined upload end point
1 parent 660dd5d commit de49280

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

Client/src/common/AMCApplication.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ export default class AMCApplication extends Common.AMCObject {
511511

512512
uploadObject.setStateMessageToWaiting ();
513513

514-
application.axiosPostRequest("/upload/finish", {
514+
application.axiosPostRequest("/upload/" + uploadObject.streamuuid + "/finish", {
515515
"streamuuid": uploadObject.streamuuid,
516516
"context": "build",
517517
"sha256": checkSum

Implementation/API/amc_api_handler_upload.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,22 @@ APIHandler_UploadType CAPIHandler_Upload::parseRequest(const std::string& sURI,
8787
else {
8888

8989
if (sParameterString == "/finish") {
90+
// This is the legacy finish upload endpoint, might be deprecated in the future
9091
return APIHandler_UploadType::utFinishUpload;
9192
}
9293

94+
95+
if ((sParameterString.substr(0, 1) == "/") && (sParameterString.length() == 44)) {
96+
std::string sAdditionalPath = sParameterString.substr(37, 7);
97+
98+
if (sAdditionalPath == "/finish") {
99+
// this is the /{uploaduuid}/finish endpoint, which replaces /finish
100+
uploadUUID = AMCCommon::CUtils::normalizeUUIDString(sParameterString.substr(1, 36));
101+
return APIHandler_UploadType::utFinishUpload;
102+
}
103+
}
104+
105+
93106
if ((sParameterString.substr(0,1) == "/") && (sParameterString.length() == 37)) {
94107
uploadUUID = AMCCommon::CUtils::normalizeUUIDString(sParameterString.substr(1));
95108
return APIHandler_UploadType::utStreamUpload;

0 commit comments

Comments
 (0)