From b309bd364947dbb78cea0ab8e13348b9cd54fc96 Mon Sep 17 00:00:00 2001 From: May P Date: Mon, 23 Mar 2026 17:46:12 +0200 Subject: [PATCH] iwasnot --- services/natQueue.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/services/natQueue.js b/services/natQueue.js index 89932ef..6995863 100644 --- a/services/natQueue.js +++ b/services/natQueue.js @@ -22,10 +22,12 @@ async function opnsenseRequest(method, path, body = null) { method, headers: { 'Authorization': `Basic ${auth}`, - 'Content-Type': 'application/json', }, }; - if (body) opts.body = JSON.stringify(body); + if (body) { + opts.headers['Content-Type'] = 'application/json'; + opts.body = JSON.stringify(body); + } const res = await fetch(`${process.env.OPNSENSE_HOST}${path}`, opts); const text = await res.text(); try { @@ -80,9 +82,7 @@ export function enqueueNatRemove(ip, port, proto = 'tcp/udp') { info(rule.descr); if (rule.descr === `pelican-${ip}-${port}`) { info(JSON.stringify(rule)); - let res = await opnsenseRequest('POST', `/api/firewall/d_nat/delRule`, { - uuid: rule.uuid, - }); + let res = await opnsenseRequest('POST', `/api/firewall/d_nat/delRule/${rule.uuid}`); info(JSON.stringify(res)); success(`deleted rule udp+tcp at ${ip}:${port}`); }