From af8ab3efab70f4f8976d0e3d714a933bd03103e2 Mon Sep 17 00:00:00 2001 From: KelvinTegelaar <49186168+KelvinTegelaar@users.noreply.github.com> Date: Mon, 7 Aug 2023 16:18:01 +0200 Subject: [PATCH] force typecasting? --- PublicWebhooks/run.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PublicWebhooks/run.ps1 b/PublicWebhooks/run.ps1 index d19ca836883f..c9834d51af1f 100644 --- a/PublicWebhooks/run.ps1 +++ b/PublicWebhooks/run.ps1 @@ -18,7 +18,7 @@ if ($Request.CIPPID -in $Webhooks.CIPPID) { $body = $request.query.ValidationToken } Write-Host "Request body: $($request.body | ConvertTo-Json -Depth 10)" - foreach ($ReceivedItem in $Request.body) { + foreach ($ReceivedItem in ([pscustomobject]$Request.body)) { Write-Host "ContentUri received: $($ReceivedItem.ContentUri)" if ($ReceivedItem.ContentUri -notlike "https://manage.office.com/api/v1.0/*") { Write-Host "Potential url forgery detected. Quitting to not send headers."