diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2012-06-07 00:28:01 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2012-06-07 00:28:01 +0200 |
commit | 386eb208881e6d5c3866b28269398f7f0b66a735 (patch) | |
tree | e47bae7940d56e1d59efa77d73ba5f7131d2b38a /src | |
parent | Letting SHIFT + MidClick reverse open new tab settings (diff) | |
download | rekonq-386eb208881e6d5c3866b28269398f7f0b66a735.tar.xz |
Restore previous Referer management
Diffstat (limited to 'src')
-rw-r--r-- | src/webview.cpp | 19 | ||||
-rw-r--r-- | src/webview.h | 5 |
2 files changed, 24 insertions, 0 deletions
diff --git a/src/webview.cpp b/src/webview.cpp index b592335c..f8f44b6a 100644 --- a/src/webview.cpp +++ b/src/webview.cpp @@ -104,6 +104,25 @@ WebView::~WebView() } +void WebView::load (const QUrl &url) +{ + load(QNetworkRequest(url)); +} + + +void WebView::load (const QNetworkRequest &req, QNetworkAccessManager::Operation op, const QByteArray &body) +{ + QNetworkRequest request = req; + const QUrl &reqUrl = request.url(); + if (reqUrl.host() == url().host()) + { + request.setRawHeader(QByteArray("Referer"), url().toEncoded()); + } + + KWebView::load(request, op, body); +} + + void WebView::loadStarted() { hideAccessKeys(); diff --git a/src/webview.h b/src/webview.h index bfc46135..4adc6ec7 100644 --- a/src/webview.h +++ b/src/webview.h @@ -66,6 +66,11 @@ public: WebPage *page(); + void load (const QUrl &url); + void load (const QNetworkRequest &req, + QNetworkAccessManager::Operation op = QNetworkAccessManager::GetOperation, + const QByteArray & body = QByteArray() ); + protected: void contextMenuEvent(QContextMenuEvent *event); |