Skip to content

Commit

Permalink
Do not include OS in HTTP user agent depending on privacy setting
Browse files Browse the repository at this point in the history
  • Loading branch information
Piratonym committed Apr 9, 2017
1 parent 65909b8 commit b06a914
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
8 changes: 7 additions & 1 deletion src/mumble/NetworkConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,5 +158,11 @@ QNetworkReply *Network::get(const QUrl &url) {

void Network::prepareRequest(QNetworkRequest &req) {
req.setAttribute(QNetworkRequest::HttpPipeliningAllowedAttribute, true);
req.setRawHeader(QString::fromLatin1("User-Agent").toUtf8(), QString::fromLatin1("Mozilla/5.0 (%1; %2) Mumble/%3 %4").arg(OSInfo::getOS(), OSInfo::getOSVersion(), QLatin1String(MUMTEXT(MUMBLE_VERSION_STRING)), QLatin1String(MUMBLE_RELEASE)).toUtf8());

// Do not send OS information if the corresponding privacy setting is enabled
if (g.s.bHideOS) {
req.setRawHeader(QString::fromLatin1("User-Agent").toUtf8(), QString::fromLatin1("Mozilla/5.0 Mumble/%1 %2").arg(QLatin1String(MUMTEXT(MUMBLE_VERSION_STRING)), QLatin1String(MUMBLE_RELEASE)).toUtf8());
} else {
req.setRawHeader(QString::fromLatin1("User-Agent").toUtf8(), QString::fromLatin1("Mozilla/5.0 (%1; %2) Mumble/%3 %4").arg(OSInfo::getOS(), OSInfo::getOSVersion(), QLatin1String(MUMTEXT(MUMBLE_VERSION_STRING)), QLatin1String(MUMBLE_RELEASE)).toUtf8());
}
}
8 changes: 4 additions & 4 deletions src/mumble/NetworkConfig.ui
Original file line number Diff line number Diff line change
Expand Up @@ -304,14 +304,14 @@ Prevents the client from downloading images embedded into chat messages with the
<item>
<widget class="QCheckBox" name="qcbHideOS">
<property name="toolTip">
<string>Prevent OS information being sent to the server</string>
<string>Prevent OS information being sent to Mumble and web servers</string>
</property>
<property name="whatsThis">
<string>&lt;b&gt;Don't send OS information to the server&lt;/b&gt;&lt;br/&gt;
Prevents the client from sending potentially identifying information about the operating system to the server.</string>
<string>&lt;b&gt;Don't send OS information to servers&lt;/b&gt;&lt;br/&gt;
Prevents the client from sending potentially identifying information about the operating system to the Mumble server and web servers.</string>
</property>
<property name="text">
<string>Do not send OS information to Mumble servers</string>
<string>Do not send OS information to Mumble and web servers</string>
</property>
</widget>
</item>
Expand Down

0 comments on commit b06a914

Please sign in to comment.