From 70e1615510cb8f4af0b521fc8972c1bacee6349a Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Thu, 30 May 2024 04:24:36 +0300 Subject: [PATCH] kio: set variables to valid range when the requested range is not valid in KHTTP Signed-off-by: Ivailo Monev --- kio/kio/khttp.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kio/kio/khttp.cpp b/kio/kio/khttp.cpp index f5538eda..ea8f525b 100644 --- a/kio/kio/khttp.cpp +++ b/kio/kio/khttp.cpp @@ -608,7 +608,7 @@ void KHTTPPrivate::slotNewConnection() const qint64 httpfilesize = httpfile->size(); qint64 httprangesize = httpfilesize; - const quint64 httprangestart = khttpheadersparser.rangeStart(); + quint64 httprangestart = khttpheadersparser.rangeStart(); quint64 httprangeend = khttpheadersparser.rangeEnd(); if (httprangestart != 0 || httprangeend != 0) { bool httprangevalid = true; @@ -619,6 +619,8 @@ void KHTTPPrivate::slotNewConnection() kDebug(s_khttpdebugarea) << "ranged request" << responsefilepath << httprangestart << httprangeend; if (httprangestart > httpfilesize || httprangeend > httpfilesize) { httprangevalid = false; + httprangestart = 0; + httprangesize = httpfilesize; } // if valid change status and insert required headers for a ranged request, otherwise // just ignore the range request