Skip to content

Commit ec8eda1

Browse files
committed
fix set-PodeResponseStatus when ReturnItem is not present
1 parent 71149e1 commit ec8eda1

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/Private/Helpers.ps1

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1767,17 +1767,18 @@ function Test-PodePath {
17671767
}
17681768

17691769
if ($statusCode -eq 200) {
1770-
if ($ReturnItem) {
1770+
if ($ReturnItem.IsPresent) {
17711771
return $item
17721772
}
17731773
return $true
17741774
}
17751775

1776-
if ($ReturnItem) {
1777-
# if we failed to get the file, report back the status code and/or return true/false
1778-
if (!$NoStatus.IsPresent) {
1779-
Set-PodeResponseStatus -Code $statusCode
1780-
}
1776+
# if we failed to get the file, report back the status code and/or return true/false
1777+
if (!$NoStatus.IsPresent) {
1778+
Set-PodeResponseStatus -Code $statusCode
1779+
}
1780+
1781+
if ($ReturnItem.IsPresent) {
17811782
return $null
17821783
}
17831784
return $false

0 commit comments

Comments
 (0)