diff --git a/packages/server/esp/dsc/dscProvider.js b/packages/server/esp/dsc/dscProvider.js index 050180b1..c389f4e0 100644 --- a/packages/server/esp/dsc/dscProvider.js +++ b/packages/server/esp/dsc/dscProvider.js @@ -14,7 +14,11 @@ class DscProvider { async connectApiCall() { return axios.get(`${config.dscUrl}`, { - headers: { apiKey: this.apiKey, 'Content-Type': 'application/json' }, + headers: { + apiKey: this.apiKey, + 'Content-Type': 'application/json', + 'User-Agent': config.dscUserAgent, + }, }); } @@ -49,6 +53,7 @@ class DscProvider { headers: { apiKey: this.apiKey, 'Content-Type': 'application/json', + 'User-Agent': config.dscUserAgent, }, }); } @@ -57,7 +62,11 @@ class DscProvider { const url = `${config.dscUrl}/withTypeCampagne`; try { return await axios.post(url, restData, { - headers: { apiKey: this.apiKey, 'Content-Type': 'application/json' }, + headers: { + apiKey: this.apiKey, + 'Content-Type': 'application/json', + 'User-Agent': config.dscUserAgent, + }, params: { typeCampagne }, }); } catch (error) { @@ -69,7 +78,11 @@ class DscProvider { const url = `${config.dscUrl}/withTypeCampagne/${campaignMailId}`; try { return await axios.put(url, restData, { - headers: { apiKey: this.apiKey, 'Content-Type': 'application/json' }, + headers: { + apiKey: this.apiKey, + 'Content-Type': 'application/json', + 'User-Agent': config.dscUserAgent, + }, params: { typeCampagne }, }); } catch (error) { diff --git a/packages/server/node.config.js b/packages/server/node.config.js index f22e760c..45c05c4a 100644 --- a/packages/server/node.config.js +++ b/packages/server/node.config.js @@ -61,6 +61,7 @@ const config = rc('lepatron', { }, proxyUrl: process.env.QUOTAGUARDSTATIC_URL, dscUrl: process.env.DSC_ESP_URL, + dscUserAgent: process.env.DSC_USER_AGENT, NODE_ENV: process.env.NODE_ENV, });