aboutsummaryrefslogtreecommitdiff
path: root/lib/web/webprofile.cpp
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2018-10-07 13:20:54 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2018-10-07 18:19:19 +0200
commit2a5ea0269a1f9511c51d661a6c7d7bdc7d0176fa (patch)
tree7649cf4c1c20bbe8c801d642148992eea314d3ec /lib/web/webprofile.cpp
parentAdd hint on enabling plugins to makepkg (diff)
downloadsmolbote-2a5ea0269a1f9511c51d661a6c7d7bdc7d0176fa.tar.xz
Expand HTTP header settings #4
- add doc/Usage/Filter.asciidoc to explain the usage of the filter headers - add HTTP headers to Profile (section "headers") - Use request interceptor to apply filter headers, then profile headers - add insert/delete actions to ProfileEditor
Diffstat (limited to 'lib/web/webprofile.cpp')
-rw-r--r--lib/web/webprofile.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/web/webprofile.cpp b/lib/web/webprofile.cpp
index bd84d38..16c12b7 100644
--- a/lib/web/webprofile.cpp
+++ b/lib/web/webprofile.cpp
@@ -135,6 +135,20 @@ void WebProfile::setHttpUserAgent(const QString &userAgent)
emit propertyChanged("httpUserAgent", userAgent);
}
+void WebProfile::setHttpHeader(const QString& name, const QString& value)
+{
+ m_headers[name.toLatin1()] = value.toLatin1();
+ emit headerChanged(name, value);
+}
+
+void WebProfile::removeHttpHeader(const QString& name)
+{
+ if(m_headers.contains(name.toLatin1())) {
+ m_headers.remove(name.toLatin1());
+ emit headerRemoved(name);
+ }
+}
+
void WebProfile::setSpellCheckEnabled(bool enable)
{
QWebEngineProfile::setSpellCheckEnabled(enable);