From 79ca86874da9d65a7148325f161fc358d7c1cb8b Mon Sep 17 00:00:00 2001 From: orfelorfel23 Date: Fri, 28 Aug 2026 17:00:48 +0200 Subject: [PATCH] fix: use correct protocol module for webhook request --- tokenwatch-sync.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tokenwatch-sync.js b/tokenwatch-sync.js index ab9a120..1d9758a 100644 --- a/tokenwatch-sync.js +++ b/tokenwatch-sync.js @@ -93,8 +93,11 @@ async function syncToTokenWatch(quotaData) { const postData = JSON.stringify(quotaData); // Ersetze diese URL durch die echte von TokenWatch auf der Jannik-Cloud, sobald sie läuft. const url = 'https://tokenwatch.orfel.de/api/webhook/antigravity'; + const isHttps = url.startsWith('https'); + const client = isHttps ? https : http; + return new Promise((resolve) => { - const req = http.request(url, { + const req = client.request(url, { method: 'POST', headers: { 'Content-Type': 'application/json', 'Content-Length': Buffer.byteLength(postData) } }, (res) => {