🐛 Fix bug that OAuth1 requests did not work anymore

This commit is contained in:
Jan Oberhauser 2020-12-10 10:39:11 +01:00
parent c87382c086
commit b73349a3a5

View file

@ -241,6 +241,15 @@ export function requestOAuth1(this: IAllExecuteFunctions, credentialsType: strin
//@ts-ignore //@ts-ignore
requestOptions.data = { ...requestOptions.qs, ...requestOptions.form }; 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 //@ts-ignore
requestOptions.headers = oauth.toHeader(oauth.authorize(requestOptions, token)); requestOptions.headers = oauth.toHeader(oauth.authorize(requestOptions, token));