mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-24 04:04:06 -08:00
fix(Github Trigger Node): Enforce SSL validation by default (#8265)
This commit is contained in:
parent
9d40ae8b74
commit
1387541e33
|
@ -434,6 +434,23 @@ export class GithubTrigger implements INodeType {
|
|||
default: [],
|
||||
description: 'The events to listen to',
|
||||
},
|
||||
{
|
||||
displayName: 'Options',
|
||||
name: 'options',
|
||||
type: 'collection',
|
||||
placeholder: 'Add Option',
|
||||
default: {},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Insecure SSL',
|
||||
name: 'insecureSSL',
|
||||
type: 'boolean',
|
||||
default: false,
|
||||
description:
|
||||
'Whether the SSL certificate of the n8n host be verified by GitHub when delivering payloads',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
|
@ -465,7 +482,7 @@ export class GithubTrigger implements INodeType {
|
|||
return false;
|
||||
}
|
||||
|
||||
// Some error occured
|
||||
// Some error occurred
|
||||
throw error;
|
||||
}
|
||||
// If it did not error then the webhook exists
|
||||
|
@ -488,14 +505,14 @@ export class GithubTrigger implements INodeType {
|
|||
const events = this.getNodeParameter('events', []);
|
||||
|
||||
const endpoint = `/repos/${owner}/${repository}/hooks`;
|
||||
const options = this.getNodeParameter('options') as { insecureSSL: boolean };
|
||||
|
||||
const body = {
|
||||
name: 'web',
|
||||
config: {
|
||||
url: webhookUrl,
|
||||
content_type: 'json',
|
||||
// secret: '...later...',
|
||||
insecure_ssl: '1', // '0' -> not allow inscure ssl | '1' -> allow insercure SSL
|
||||
insecure_ssl: options.insecureSSL ? '1' : '0',
|
||||
},
|
||||
events,
|
||||
active: true,
|
||||
|
|
Loading…
Reference in a new issue