Skip to content

Commit

Permalink
Allow redirects for image preview in webkit
Browse files Browse the repository at this point in the history
  • Loading branch information
Ri0n committed Jun 7, 2017
1 parent 345108b commit bf95ea4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/chatview_webkit.cpp
Expand Up @@ -254,7 +254,12 @@ public slots:
void getUrlHeaders(const QString &tId, const QString url) void getUrlHeaders(const QString &tId, const QString url)
{ {
//qDebug() << "getUrlHeaders: tId=" << tId << " url=" << url; //qDebug() << "getUrlHeaders: tId=" << tId << " url=" << url;
auto reply = _view->d->account_->psi()->networkAccessManager()->head(QNetworkRequest(QUrl::fromEncoded(url.toLatin1()))); QNetworkRequest req(QUrl::fromEncoded(url.toLatin1()));
#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
req.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
req.setMaximumRedirectsAllowed(2);
#endif
auto reply = _view->d->account_->psi()->networkAccessManager()->head(req);
reply->setProperty("tranId", tId); reply->setProperty("tranId", tId);
connect(reply, SIGNAL(finished()), SLOT(onUrlHeadersReady())); connect(reply, SIGNAL(finished()), SLOT(onUrlHeadersReady()));
} }
Expand Down

0 comments on commit bf95ea4

Please sign in to comment.