mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
fix(Customer.io Node): Allow EU customer.io domains in credential (#14880)
Co-authored-by: Michael Kret <michael.k@radency.com>
This commit is contained in:
@@ -65,13 +65,21 @@ export class CustomerIoApi implements ICredentialType {
|
|||||||
): Promise<IHttpRequestOptions> {
|
): Promise<IHttpRequestOptions> {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
const url = new URL(requestOptions.url ? requestOptions.url : requestOptions.uri);
|
const url = new URL(requestOptions.url ? requestOptions.url : requestOptions.uri);
|
||||||
if (url.hostname === 'track.customer.io' || url.hostname === 'api.customer.io') {
|
if (
|
||||||
|
url.hostname === 'track.customer.io' ||
|
||||||
|
url.hostname === 'track-eu.customer.io' ||
|
||||||
|
url.hostname === 'api.customer.io' ||
|
||||||
|
url.hostname === 'api-eu.customer.io'
|
||||||
|
) {
|
||||||
const basicAuthKey = Buffer.from(
|
const basicAuthKey = Buffer.from(
|
||||||
`${credentials.trackingSiteId}:${credentials.trackingApiKey}`,
|
`${credentials.trackingSiteId}:${credentials.trackingApiKey}`,
|
||||||
).toString('base64');
|
).toString('base64');
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
Object.assign(requestOptions.headers, { Authorization: `Basic ${basicAuthKey}` });
|
Object.assign(requestOptions.headers, { Authorization: `Basic ${basicAuthKey}` });
|
||||||
} else if (url.hostname === 'beta-api.customer.io') {
|
} else if (
|
||||||
|
url.hostname === 'beta-api.customer.io' ||
|
||||||
|
url.hostname === 'beta-api-eu.customer.io'
|
||||||
|
) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
Object.assign(requestOptions.headers, {
|
Object.assign(requestOptions.headers, {
|
||||||
Authorization: `Bearer ${credentials.appApiKey as string}`,
|
Authorization: `Bearer ${credentials.appApiKey as string}`,
|
||||||
|
|||||||
Reference in New Issue
Block a user