From dfbd4c35576ecb484585cb8b698379858530be18 Mon Sep 17 00:00:00 2001 From: Benjamin Toby Date: Sat, 13 Jul 2024 11:53:35 +0100 Subject: [PATCH] Bugfix --- utils/get.js | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/utils/get.js b/utils/get.js index dbb5274..b8631ed 100644 --- a/utils/get.js +++ b/utils/get.js @@ -104,18 +104,23 @@ async function get({ key, db, query, queryValues, tableName }) { }`; } + /** @type {https.RequestOptions} */ + const requestObject = { + method: "GET", + headers: { + "Content-Type": "application/json", + Authorization: key, + }, + port: localHostPort || 443, + hostname: localHost || "datasquirel.com", + path: encodeURIComponent(path), + }; + + console.log("requestObject =>", requestObject); + (scheme?.match(/^http$/i) ? http : https) .request( - { - method: "GET", - headers: { - "Content-Type": "application/json", - Authorization: key, - }, - port: localHostPort || 443, - hostname: localHost || "datasquirel.com", - path: encodeURIComponent(path), - }, + requestObject, /** * Callback Function