From 9ff69dd6dcf87d74e6c71bdb247b4aa26c028c2b 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 cbc0bf38c5..9ffb416fbe 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; }