From b2e32abe7e5da571c0dd3d5e11a5cfd46fe068f4 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sun, 4 Jan 2015 23:15:58 +0100 Subject: [PATCH] + fixes #0001705: Download manager does not follow redirect (HTTP status 302) --- src/Gui/DownloadManager.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Gui/DownloadManager.cpp b/src/Gui/DownloadManager.cpp index cbc0bf38c..9ffb416fb 100644 --- a/src/Gui/DownloadManager.cpp +++ b/src/Gui/DownloadManager.cpp @@ -123,6 +123,15 @@ QUrl DownloadManager::redirectUrl(const QUrl& url) const } } } + else { + // When the url comes from drag and drop it may end with CR+LF. This may cause problems + // and thus should be removed. + QString str = redirectUrl.toString(); + if (str.endsWith(QLatin1String("\r\n"))) { + str.chop(2); + redirectUrl.setUrl(str); + } + } return redirectUrl; }