sapmentors / cds-scp-api

CDS Extension for SAP Cloud Platform API Consumption
MIT License
15 stars 5 forks source link

headers data passed in from client app gets removed in function getAuthorizationHeader #6

Open chongwahng opened 2 years ago

chongwahng commented 2 years ago

Issue found at line 35 in destination.js of function "getAuthorizationHeader". This line removes the entire "headers" data passed in from client app and replaced it with auth token retrieved from destination.

function getAuthorizationHeader(_config, cfDestinationInfo) { return new Promise((resolve, reject) => { var error; var config = Object.assign({}, _config); //config.headers = {} ***** DEFECT

chongwahng commented 2 years ago

Shall I fork a new project and send in the changes with new pull request?

gregorwolf commented 2 years ago

Yes, please go ahead with a for and PR.

chongwahng commented 2 years ago

Just notice the change was already applied 4 months ago in your project file destination.js

"config.headers = {}" has been changed to "config.headers = config.headers || {};", however this change has not been officially released to npm registry yet.

lniecap commented 2 years ago

Is the fix planned to be officially released any time soon? There's still a version in the npm registry with the defect.

gregorwolf commented 2 years ago

Hi @raeijpe would you be able to take care of this issue and PR?