From dbf4b5988de94db6d50b6ee7a0aa4e06d789f18c Mon Sep 17 00:00:00 2001 From: Brian Schrader Date: Mon, 28 Nov 2022 11:59:57 -0800 Subject: [PATCH] Adds support for passing Authentication Credentials & Query Params via CALLBACK_URL This change allows for a server to contain both query params and optional HTTP Basic Auth credentials. --- bin/callback.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/callback.js b/bin/callback.js index 4da81637..8fd9a390 100644 --- a/bin/callback.js +++ b/bin/callback.js @@ -38,9 +38,14 @@ const callbackRequest = (url, timeout, data) => { const options = { hostname: url.hostname, port: url.port, - path: url.pathname, + path: url.pathname + url.search, timeout, method: 'POST', + auth: ( + (url.username || url.password) + ? url.username + ':' + url.password + : '' + ), headers: { 'Content-Type': 'application/json', 'Content-Length': data.length