From b73349a3a540173b46d1ada281d5f0197500d5d0 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Thu, 10 Dec 2020 10:39:11 +0100 Subject: [PATCH] :bug: Fix bug that OAuth1 requests did not work anymore --- packages/core/src/NodeExecuteFunctions.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/core/src/NodeExecuteFunctions.ts b/packages/core/src/NodeExecuteFunctions.ts index fcca59d9fe..1006b29100 100644 --- a/packages/core/src/NodeExecuteFunctions.ts +++ b/packages/core/src/NodeExecuteFunctions.ts @@ -241,6 +241,15 @@ export function requestOAuth1(this: IAllExecuteFunctions, credentialsType: strin //@ts-ignore requestOptions.data = { ...requestOptions.qs, ...requestOptions.form }; + // Fixes issue that OAuth1 library only works with "url" property and not with "uri" + // @ts-ignore + if (requestOptions.uri && !requestOptions.url) { + // @ts-ignore + requestOptions.url = requestOptions.uri; + // @ts-ignore + delete requestOptions.uri; + } + //@ts-ignore requestOptions.headers = oauth.toHeader(oauth.authorize(requestOptions, token));