diff --git a/src/handlers/xdgurl.cpp b/src/handlers/xdgurl.cpp index 57446a87995d1584229ba0ef6eb53a728df7b7f4..c5d4dbfd881d171673dad6694ff1d4d9671451ff 100644 --- a/src/handlers/xdgurl.cpp +++ b/src/handlers/xdgurl.cpp @@ -225,7 +225,15 @@ void XdgUrl::_downloaded(QNetworkReply *reply) return; } - // If the network reply has a refresh header, retry download + if (reply->hasRawHeader("Location")) { + QString redirectUrl = QString(reply->rawHeader("Location")); + if (redirectUrl.startsWith("/")) { + redirectUrl = reply->url().authority() + redirectUrl; + } + _network->get(QUrl(redirectUrl)); + return; + } + if (reply->hasRawHeader("Refresh")) { QString refreshUrl = QString(reply->rawHeader("Refresh")).split("url=").last(); if (refreshUrl.startsWith("/")) {