Skip to content
Permalink
Browse files

Allow redirects for image preview in webkit

  • Loading branch information...
Ri0n committed Jun 7, 2017
1 parent 345108b commit bf95ea412f951416a98a4eee784bc540b05981a9
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/chatview_webkit.cpp
@@ -254,7 +254,12 @@ public slots:
void getUrlHeaders(const QString &tId, const QString 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);
connect(reply, SIGNAL(finished()), SLOT(onUrlHeadersReady()));
}

0 comments on commit bf95ea4

Please sign in to comment.
You can’t perform that action at this time.