Skip to content

Commit 668310f

Browse files
authored
Merge pull request #373 from KelvinTegelaar/dev
[pull] dev from KelvinTegelaar:dev
2 parents 9edfb2e + abd014a commit 668310f

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Modules/CippEntrypoints/CippEntrypoints.psm1

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,16 @@ function Receive-CippHttpTrigger {
5353
if ($FunctionName -eq 'Invoke-Me') {
5454
return
5555
}
56-
56+
} catch {
57+
Write-Information "Access denied for $FunctionName : $($_.Exception.Message)"
58+
Push-OutputBinding -Name Response -Value ([HttpResponseContext]@{
59+
StatusCode = [HttpStatusCode]::Forbidden
60+
Body = $_.Exception.Message
61+
})
62+
return
63+
}
64+
65+
try {
5766
Write-Information "Access: $Access"
5867
if ($Access) {
5968
& $FunctionName @HttpTrigger

0 commit comments

Comments
 (0)