Have you tried in GWS:
var apim = require('./apim.custom.js');
....
apim.setvariable('message.headers.Access-Control-Allow-Origin', 'null', 'clear');
------------------------------
Joseph Morgan
------------------------------
Original Message:
Sent: Tue March 14, 2023 04:17 PM
From: Kshitij Khanna
Subject: I want to remove the CORS Headers - Access-Control-Allow-Origin & Access-Control-Allow-Methods from Response sent to client
I want to remove the CORS Headers - Access-Control-Allow-Origin & Access-Control-Allow-Methods from the response for a service.
I tried the following methods in the assembly but they didnt work.
Javascript :
hm.current.remove('Access-Control-Allow-Origin');
XSLT:
<dp:remove-http-response-header name="Access-Control-Allow-Origin"/>
------------------------------
Kshitij Khanna
------------------------------