Skip to content

Commit

Permalink
Fix default statuscode to 200 unless 0
Browse files Browse the repository at this point in the history
  • Loading branch information
Mistuke committed Mar 11, 2018
1 parent 42d4885 commit 707e289
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cabal-install/Distribution/Client/HttpUtils.hs
Original file line number Diff line number Diff line change
Expand Up @@ -671,8 +671,12 @@ powershellTransport prog =
, "}"
, ""
, "$responseStream = $request.getresponse()"
, "Write-Host ($response.StatusCode -as [int]);"
, "$responseReader = new-object System.IO.StreamReader $responseStream.GetResponseStream()"
, "$code = $response.StatusCode -as [int]"
, "if ($code -eq 0) {"
, " $code = 200;"
, "}"
, "Write-Host $code"
, "Write-Host $responseReader.ReadToEnd()"
]

Expand Down

0 comments on commit 707e289

Please sign in to comment.