1437
This commit is contained in:
7
samy.ps1
7
samy.ps1
@@ -1434,6 +1434,13 @@ function Send-JSON {
|
||||
$raw = (New-Object IO.StreamReader $Context.Request.InputStream).ReadToEnd()
|
||||
$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 ★
|
||||
$Global:WebhookPassword = $pw
|
||||
|
||||
|
||||
Reference in New Issue
Block a user