From 7fc2eb2fcc1b90f36e1bd76f80e0fd3b610b3587 Mon Sep 17 00:00:00 2001 From: Daniel Carl Date: Fri, 29 Aug 2014 23:00:47 +0200 Subject: [PATCH] Fixed download with content-range header (#101). If the server responds with an Accept-Range header without content the download was not started. In this case we got the status_code 0 which indicates that libsoup has not sent the message. Now we accept status_code 0 and the 2xx. --- src/main.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main.c b/src/main.c index 46932dc..bab1570 100644 --- a/src/main.c +++ b/src/main.c @@ -1214,9 +1214,13 @@ static gboolean mimetype_decision_cb(WebKitWebView *webview, return false; } - /* don't start a download when the response has no 2xx status code */ + /* Don't start a download when the response has no 2xx status code. Or the + * message was not sent before - this seems to be the case when the server + * responds with a Accept-Ranges header. */ msg = webkit_network_request_get_message(request); - if (SOUP_STATUS_IS_SUCCESSFUL(msg->status_code)) { + if (SOUP_STATUS_IS_SUCCESSFUL(msg->status_code) + || msg->status_code == SOUP_STATUS_NONE + ) { webkit_web_policy_decision_download(decision); return true; } -- 2.20.1