Handle redirects when downloading Spotify blob.
Use the NoLessSafeRedirectPolicy policy which will redirect as long as it isn't from https to http.
This commit is contained in:
parent
94eb2dcfc1
commit
a85b3531c3
|
@ -95,7 +95,13 @@ void SpotifyBlobDownloader::Start() {
|
||||||
filename);
|
filename);
|
||||||
qLog(Info) << "Downloading" << url;
|
qLog(Info) << "Downloading" << url;
|
||||||
|
|
||||||
QNetworkReply* reply = network_->get(QNetworkRequest(url));
|
QNetworkRequest req(url);
|
||||||
|
// This policy will work as long as there isn't a redirect from https to
|
||||||
|
// http.
|
||||||
|
req.setAttribute(QNetworkRequest::RedirectPolicyAttribute,
|
||||||
|
QNetworkRequest::NoLessSafeRedirectPolicy);
|
||||||
|
|
||||||
|
QNetworkReply* reply = network_->get(req);
|
||||||
connect(reply, SIGNAL(finished()), SLOT(ReplyFinished()));
|
connect(reply, SIGNAL(finished()), SLOT(ReplyFinished()));
|
||||||
connect(reply, SIGNAL(downloadProgress(qint64, qint64)),
|
connect(reply, SIGNAL(downloadProgress(qint64, qint64)),
|
||||||
SLOT(ReplyProgress()));
|
SLOT(ReplyProgress()));
|
||||||
|
|
Loading…
Reference in New Issue