From a9cc1160ab5cf26c865b81d4b6ba41be249dde0e Mon Sep 17 00:00:00 2001 From: Stephan Yelle Date: Sat, 20 Dec 2025 13:06:05 -0500 Subject: [PATCH] Update samy.ps1 --- samy.ps1 | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/samy.ps1 b/samy.ps1 index c6b8892..0a9504d 100644 --- a/samy.ps1 +++ b/samy.ps1 @@ -1826,29 +1826,12 @@ function Invoke-GetPrinters { return } - # Read JSON body: { "password": "..." } - $rawBody = (New-Object IO.StreamReader $Context.Request.InputStream).ReadToEnd() - if (-not $rawBody) { - $Context.Response.StatusCode = 400 - Send-Text $Context 'Missing request body.' - return - } - - try { - $body = $rawBody | ConvertFrom-Json - } catch { - $Context.Response.StatusCode = 400 - Send-Text $Context 'Invalid JSON body.' - return - } - # Allow blank password (IP allowlist handled server-side) $password = [string]$body.password # $null -> '' if ($password -eq '') { Write-LogHybrid "Printer password is blank; relying on allowlisted IP (server-side)." Info Printers -LogToEvent } - $uri = 'https://bananas.svstools.ca/getprinters' Write-LogHybrid "Fetching printers from $uri" Info Printers -LogToEvent