From de4204d82c9b825952f3aa38229c67da95804cd9 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Thu, 30 May 2024 00:29:32 +0300 Subject: [PATCH] kio: fake bytes range support for KHTTP as the RFC says - the server (KHTTP in this case) can ignore range requests, tested with curl and wget and both will not get a range transfer but the request will not fail because the server does not support ranges Signed-off-by: Ivailo Monev --- kio/kio/khttp.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kio/kio/khttp.cpp b/kio/kio/khttp.cpp index 2d85de59..408c01a2 100644 --- a/kio/kio/khttp.cpp +++ b/kio/kio/khttp.cpp @@ -278,9 +278,9 @@ static KHTTPHeaders HTTPHeaders(const QString &serverid, const bool authenticate // optional for anything but 405, see: // https://www.rfc-editor.org/rfc/rfc9110.html#section-10.2.1 khttpheaders.insert("Allow", "GET, HEAD"); - // optional, see: + // optional (the range request can be ignored), see: // https://www.rfc-editor.org/rfc/rfc9110.html#section-14.3 - khttpheaders.insert("Accept-Ranges", "none"); + khttpheaders.insert("Accept-Ranges", "bytes"); // TODO: maybe implement persistent connections khttpheaders.insert("Connection", "close"); if (authenticate) {