From 4b8c6147d360b153d1ee13369ed2fc62a3d69c5c Mon Sep 17 00:00:00 2001 From: YErii Date: Thu, 27 Aug 2020 04:54:00 +0800 Subject: [PATCH] :bug: Update salesforce node's get subdomain function (#834) Original function will not match subdomains like `https://a.b.c.salesforce.com` and use regular expression to get the subdomain. --- packages/nodes-base/nodes/Salesforce/GenericFunctions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nodes-base/nodes/Salesforce/GenericFunctions.ts b/packages/nodes-base/nodes/Salesforce/GenericFunctions.ts index 4c81432238..c86e8ce676 100644 --- a/packages/nodes-base/nodes/Salesforce/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Salesforce/GenericFunctions.ts @@ -10,7 +10,7 @@ import { export async function salesforceApiRequest(this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, method: string, resource: string, body: any = {}, qs: IDataObject = {}, uri?: string, option: IDataObject = {}): Promise { // tslint:disable-line:no-any const credentials = this.getCredentials('salesforceOAuth2Api'); - const subdomain = (credentials!.accessTokenUrl as string).split('.')[0].split('/')[2]; + const subdomain = ((credentials!.accessTokenUrl as string).match(/https:\/\/(.+).salesforce\.com/) || [])[1] const options: OptionsWithUri = { method, body,