This commit is contained in:
2025-12-19 17:04:19 -05:00
parent aaf2b9d931
commit 71b0a60d51

View File

@@ -1434,6 +1434,13 @@ function Send-JSON {
$raw = (New-Object IO.StreamReader $Context.Request.InputStream).ReadToEnd() $raw = (New-Object IO.StreamReader $Context.Request.InputStream).ReadToEnd()
$pw = (ConvertFrom-Json $raw).password $pw = (ConvertFrom-Json $raw).password
$trusted = Test-TrustedCaller -Context $Context
if ([string]::IsNullOrWhiteSpace($pw) -and -not $trusted) {
$Context.Response.StatusCode = 401
Send-Text $Context "Password required from untrusted IP."
return
}
# ★ Store it globally for the next call ★ # ★ Store it globally for the next call ★
$Global:WebhookPassword = $pw $Global:WebhookPassword = $pw