From 0355c423a4b8f4e48a4f6e2b3b35ef03fa26ea16 Mon Sep 17 00:00:00 2001 From: cpayne Date: Mon, 8 Dec 2025 16:09:38 -0500 Subject: [PATCH] Fix /getprinters to use GET request type --- samy.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/samy.js b/samy.js index cac47c3..7f69c4b 100644 --- a/samy.js +++ b/samy.js @@ -234,7 +234,7 @@ async function fetchSites() { try { const resp = await fetch("/getpw", { - method: "GET", + method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ password: pwd }), }); @@ -265,7 +265,7 @@ async function fetchSites() { // ======================================================================= let allPrinters = []; -// GET /getprinters with password from Devices tab +// GET /getprinters with password from Devices tab (sent via SAMYPW header) async function fetchPrinters() { const pwdInput = document.getElementById("PrinterPassword"); const pwd = pwdInput?.value; @@ -291,8 +291,7 @@ async function fetchPrinters() { try { const resp = await fetch("/getprinters", { method: "GET", - headers: { "Content-Type": "application/json" }, - body: JSON.stringify({ password: pwd }), + headers: { SAMYPW: pwd }, }); if (!resp.ok) throw new Error("HTTP " + resp.status);