Commit da403dff authored by Edsko de Vries's avatar Edsko de Vries
Browse files

Don't ignore 206 response in plain-http transport

The plainHttpTransport implementation saved the resulting file only when the
server responded with 200 OK, thus ignoring the payload from the server when
the server responded with a 206 Partial Content. This was causing incremental
updates through hackage-security to fail (it wouldn't fail fatally;
hackage-security would notice the invalid timestamp and download the whole
thing instead, but of course this means we're not actually getting any
incremental behaviour).
parent 6ad43eed
......@@ -635,7 +635,7 @@ plainHttpTransport =
(_, resp) <- cabalBrowse verbosity Nothing (request req)
let code = convertRspCode (rspCode resp)
etag' = lookupHeader HdrETag (rspHeaders resp)
when (code==200) $
when (code==200 || code==206) $
writeFileAtomic destPath $ rspBody resp
return (code, etag')
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment