mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
⚡ Retrieve node version
This commit is contained in:
parent
402480e54d
commit
1ff95c354d
|
@ -883,15 +883,13 @@ export class HttpRequest implements INodeType {
|
||||||
];
|
];
|
||||||
|
|
||||||
let authenticateWith;
|
let authenticateWith;
|
||||||
let isHttpRequestNodeVersion1 = false;
|
const nodeVersion = this.getNode().typeVersion;
|
||||||
|
|
||||||
const responseFormat = this.getNodeParameter('responseFormat', 0) as string;
|
const responseFormat = this.getNodeParameter('responseFormat', 0) as string;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
authenticateWith = this.getNodeParameter('authenticateWith', 0) as 'nodeCredential' | 'genericAuth' | 'none';
|
authenticateWith = this.getNodeParameter('authenticateWith', 0) as 'nodeCredential' | 'genericAuth' | 'none';
|
||||||
} catch (_) {
|
} catch (_) {}
|
||||||
isHttpRequestNodeVersion1 = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
let httpBasicAuth;
|
let httpBasicAuth;
|
||||||
let httpDigestAuth;
|
let httpDigestAuth;
|
||||||
|
@ -901,7 +899,7 @@ export class HttpRequest implements INodeType {
|
||||||
let oAuth2Api;
|
let oAuth2Api;
|
||||||
let nodeCredentialType;
|
let nodeCredentialType;
|
||||||
|
|
||||||
if (authenticateWith === 'genericAuth' || isHttpRequestNodeVersion1) {
|
if (authenticateWith === 'genericAuth' || nodeVersion === 1) {
|
||||||
try {
|
try {
|
||||||
httpBasicAuth = await this.getCredentials('httpBasicAuth');
|
httpBasicAuth = await this.getCredentials('httpBasicAuth');
|
||||||
} catch (_) {}
|
} catch (_) {}
|
||||||
|
@ -1219,7 +1217,7 @@ export class HttpRequest implements INodeType {
|
||||||
if (
|
if (
|
||||||
authenticateWith === 'genericAuth' ||
|
authenticateWith === 'genericAuth' ||
|
||||||
authenticateWith === 'none' ||
|
authenticateWith === 'none' ||
|
||||||
isHttpRequestNodeVersion1
|
nodeVersion === 1
|
||||||
) {
|
) {
|
||||||
if (oAuth1Api) {
|
if (oAuth1Api) {
|
||||||
requestPromises.push(
|
requestPromises.push(
|
||||||
|
|
Loading…
Reference in a new issue