Skip to content

Commit

Permalink
fix set-PodeResponseStatus when ReturnItem is not present
Browse files Browse the repository at this point in the history
  • Loading branch information
mdaneri committed Apr 4, 2024
1 parent 71149e1 commit ec8eda1
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/Private/Helpers.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1767,17 +1767,18 @@ function Test-PodePath {
}

if ($statusCode -eq 200) {
if ($ReturnItem) {
if ($ReturnItem.IsPresent) {
return $item
}
return $true
}

if ($ReturnItem) {
# if we failed to get the file, report back the status code and/or return true/false
if (!$NoStatus.IsPresent) {
Set-PodeResponseStatus -Code $statusCode
}
# if we failed to get the file, report back the status code and/or return true/false
if (!$NoStatus.IsPresent) {
Set-PodeResponseStatus -Code $statusCode
}

if ($ReturnItem.IsPresent) {
return $null
}
return $false
Expand Down

0 comments on commit ec8eda1

Please sign in to comment.