From 009d2b3cfe2d27abd79f47aa076849786327654a Mon Sep 17 00:00:00 2001 From: davsad Date: Thu, 26 Aug 2021 10:52:12 +0100 Subject: [PATCH] Fail VF download of csar when VF has operation defined with workflow. Issue-ID: SDC-3689 Signed-off-by: davsad Change-Id: I207a95e86def05011feaa87847844e6b93b74c5e --- .../src/app/ng2/services/component-services/component.service.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/catalog-ui/src/app/ng2/services/component-services/component.service.ts b/catalog-ui/src/app/ng2/services/component-services/component.service.ts index 5d7b37f0fa..8f23f78c9d 100644 --- a/catalog-ui/src/app/ng2/services/component-services/component.service.ts +++ b/catalog-ui/src/app/ng2/services/component-services/component.service.ts @@ -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; -- 2.16.6