aboutsummaryrefslogtreecommitdiff
path: root/src/browsertab.cpp
diff options
context:
space:
mode:
authorMike Skec <skec@protonmail.ch>2021-01-06 16:32:31 +1100
committerFelix Queißner <felix@ib-queissner.de>2021-01-06 10:51:18 +0100
commit7bb342914db3894ed9fbc0855a2c0ad5ee8d999d (patch)
tree2f8c7079294bec1438176d6cf4fcfe372cde1376 /src/browsertab.cpp
parentd815c8badabb347537f26612a5edab3a71cba866 (diff)
downloadkristall-7bb342914db3894ed9fbc0855a2c0ad5ee8d999d.tar.gz
Tabs with client cert enabled no longer read from or write to cache
Helps keeps 'interactive pages' like Astrobotany updated. Error message pages are also not cached now, as they are now considered 'internal locations'
Diffstat (limited to 'src/browsertab.cpp')
-rw-r--r--src/browsertab.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/browsertab.cpp b/src/browsertab.cpp
index 7fa0ad2..5c39715 100644
--- a/src/browsertab.cpp
+++ b/src/browsertab.cpp
@@ -477,8 +477,10 @@ void BrowserTab::on_requestCompleteMime(const QByteArray &ref_data, const MimeTy
// Finally, put file in cache if we are not in an internal
// location. Don't cache if we read this page from cache.
+ // We also do not cache if user has a client certificate enabled.
if (!this->is_internal_location &&
- !this->was_read_from_cache)
+ !this->was_read_from_cache &&
+ !this->current_identity.isValid())
{
this->mainWindow->cachePage(this->current_location, data, mime);
}
@@ -828,6 +830,7 @@ void BrowserTab::on_redirected(QUrl uri, bool is_permanent)
void BrowserTab::setErrorMessage(const QString &msg)
{
+ this->is_internal_location = true;
this->on_requestComplete(
QString("An error happened:\r\n%0").arg(msg).toUtf8(),
"text/plain charset=utf-8");
@@ -1371,7 +1374,8 @@ bool BrowserTab::startRequest(const QUrl &url, ProtocolHandler::RequestOptions o
return this->current_handler->startRequest(url.adjusted(QUrl::RemoveFragment), options);
};
- if (no_read_cache) return req();
+ if (no_read_cache || this->current_identity.isValid())
+ return req();
// Check if we have the page in our cache.
urlstr = url.toString(QUrl::FullyEncoded | QUrl::RemoveFragment);