+ issue #0001705: Download manager does not follow redirect (HTTP status 302)

This commit is contained in:
wmayer
2015-01-04 18:15:20 +01:00
parent 0d1fc35b20
commit c3102b69bc
4 changed files with 65 additions and 13 deletions

View File

@@ -464,16 +464,16 @@ void DownloadItem::metaDataChanged()
header.chop(1);
m_fileName = QUrl::fromPercentEncoding(header);
}
else {
index = header.indexOf("filename*=UTF-8''");
if (index >= 0) {
header = header.mid(index+17);
if (header.startsWith("\"") || header.startsWith("'"))
header = header.mid(1);
if (header.endsWith("\"") || header.endsWith("'"))
header.chop(1);
m_fileName = QUrl::fromPercentEncoding(header);
}
// Sometimes "filename=" and "filename*=UTF-8''" is set.
// So, search for this too.
index = header.indexOf("filename*=UTF-8''");
if (index >= 0) {
header = header.mid(index+17);
if (header.startsWith("\"") || header.startsWith("'"))
header = header.mid(1);
if (header.endsWith("\"") || header.endsWith("'"))
header.chop(1);
m_fileName = QUrl::fromPercentEncoding(header);
}
}