Merge pull request #247 from xiaolai/fix/nlpm-zapier-webhook-url-validation
fix: validate https:// scheme for hooks send webhook URL in zapier.js
This commit is contained in:
@@ -122,7 +122,9 @@ async function main() {
|
|||||||
case 'hooks':
|
case 'hooks':
|
||||||
switch (sub) {
|
switch (sub) {
|
||||||
case 'send': {
|
case 'send': {
|
||||||
|
// Sends a POST to a Zapier webhook catch hook URL (e.g. https://hooks.zapier.com/hooks/catch/...)
|
||||||
if (!args.url) { result = { error: '--url required' }; break }
|
if (!args.url) { result = { error: '--url required' }; break }
|
||||||
|
if (!args.url.startsWith('https://')) { result = { error: '--url must use https://' }; break }
|
||||||
if (!args.data) { result = { error: '--data required (JSON string)' }; break }
|
if (!args.data) { result = { error: '--data required (JSON string)' }; break }
|
||||||
let data
|
let data
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user