From b63a798ad76918f4205fd5985fdd64240210b7d1 Mon Sep 17 00:00:00 2001 From: David Rosca Date: Sun, 20 Mar 2016 19:37:22 +0100 Subject: [PATCH] NetworkManager: Enable FollowRedirects and SPDY Note that NetworkManager is not used by QtWebEngine, it is used only for downloading other data by QupZilla (eg. downloading user scripts, open search engines, checking for updates, ...) --- src/lib/network/networkmanager.cpp | 11 ++++++++++- src/lib/network/networkmanager.h | 5 ++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/lib/network/networkmanager.cpp b/src/lib/network/networkmanager.cpp index 20aa9a6f4..c341f043e 100644 --- a/src/lib/network/networkmanager.cpp +++ b/src/lib/network/networkmanager.cpp @@ -1,6 +1,6 @@ /* ============================================================ * QupZilla - WebKit based browser -* Copyright (C) 2010-2014 David Rosca +* Copyright (C) 2010-2016 David Rosca * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -246,3 +246,12 @@ void NetworkManager::loadSettings() m_urlInterceptor->loadSettings(); } + +QNetworkReply *NetworkManager::createRequest(QNetworkAccessManager::Operation op, const QNetworkRequest &request, QIODevice *outgoingData) +{ + QNetworkRequest req = request; + req.setAttribute(QNetworkRequest::SpdyAllowedAttribute, true); + req.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true); + + return QNetworkAccessManager::createRequest(op, req, outgoingData); +} diff --git a/src/lib/network/networkmanager.h b/src/lib/network/networkmanager.h index 9c4b42aba..b6ddd32aa 100644 --- a/src/lib/network/networkmanager.h +++ b/src/lib/network/networkmanager.h @@ -1,6 +1,6 @@ /* ============================================================ * QupZilla - WebKit based browser -* Copyright (C) 2010-2014 David Rosca +* Copyright (C) 2010-2016 David Rosca * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -42,6 +42,9 @@ public: void loadSettings(); +protected: + QNetworkReply *createRequest(Operation op, const QNetworkRequest &request, QIODevice *outgoingData) Q_DECL_OVERRIDE; + private: NetworkUrlInterceptor *m_urlInterceptor; QHash m_ignoredSslErrors;