Fail VF download of csar when VF has operation defined with workflow. 06/123606/5
authordavsad <david.sadlier@est.tech>
Thu, 26 Aug 2021 09:52:12 +0000 (10:52 +0100)
committerMichael Morris <michael.morris@est.tech>
Fri, 10 Sep 2021 13:21:16 +0000 (13:21 +0000)
Issue-ID: SDC-3689
Signed-off-by: davsad <david.sadlier@est.tech>
Change-Id: I207a95e86def05011feaa87847844e6b93b74c5e

catalog-ui/src/app/ng2/services/component-services/component.service.ts

index 5d7b37f..8f23f78 100644 (file)
@@ -44,6 +44,7 @@ import { ConstraintObject } from "../../components/logic/service-dependencies/se
 import { Requirement } from "../../../models/requirement";
 import { Capability } from "../../../models/capability";
 import { OutputBEModel } from "app/models/attributes-outputs/output-be-model";
+import { HttpHelperService } from '../http-hepler.service';
 
 /*
 PLEASE DO NOT USE THIS SERVICE IN ANGULAR2! Use the topology-template.service instead
@@ -235,14 +236,10 @@ export class ComponentServiceNg2 {
             payloadData: oldOperation.artifactData
         };
 
-
-        JSON.stringify(payload);
-        const payloadString = JSON.stringify(payload, null, '  ');
-        const md5Result = md5(payloadString).toLowerCase();
-        const headers = new HttpHeaders().append('Content-MD5', btoa(md5Result));
+        const headers = new HttpHeaders().append('Content-MD5', HttpHelperService.getHeaderMd5(payload));
 
         return this.http.post(this.baseUrl + component.getTypeUrl() + component.uuid + '/interfaces/' + newOperation.interfaceId + '/operations/' + newOperation.uniqueId + '/artifacts/' + newOperation.implementation.artifactUUID,
-                payload, {headers}
+                payload, {headers: headers}
             ).map((res: any) => {
                 const fileName = res.artifactDisplayName || res.artifactName;
                 newOperation.artifactFileName = fileName;