commit 4e3d4c6ee26f32765a679eb435c1ceda032bbf8b
parent 390a362fe7b1bd613bef95a3ef62f73002bf7b6d
Author: cfillion <cfillion@users.noreply.github.com>
Date: Wed, 20 Jan 2016 22:33:50 -0500
support local downloads from the file:// protocol
Diffstat:
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/download.cpp b/src/download.cpp
@@ -123,13 +123,15 @@ DWORD WINAPI Download::Worker(void *ptr)
int status = 0;
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
- if(status == 200) {
+ // accept a status of 0 for the file:// protocol
+ if(status == 200 || status == 0) {
// strip headers
long headerSize = 0;
curl_easy_getinfo(curl, CURLINFO_HEADER_SIZE, &headerSize);
contents.erase(0, headerSize);
- download->finish(status, contents);
+ // always send 200, even for file://
+ download->finish(200, contents);
}
else {
// strip body