summaryrefslogtreecommitdiffstats
path: root/services/sync/modules/rest.js
diff options
context:
space:
mode:
authorwicknix <39230578+wicknix@users.noreply.github.com>2019-04-15 18:58:07 -0500
committerGitHub <noreply@github.com>2019-04-15 18:58:07 -0500
commit5a1843c9f9e323627f9c35529e6a8c853d4dbb0d (patch)
tree62de3cd7cb8a6f75e568863bb73ca2deb80d87a9 /services/sync/modules/rest.js
parent065f6f9e5ebc1ed6cfaadaf7851b6021fa94a013 (diff)
parent095ea556855b38138e39e713f482eb440f7da9b2 (diff)
downloadUXP-5a1843c9f9e323627f9c35529e6a8c853d4dbb0d.tar
UXP-5a1843c9f9e323627f9c35529e6a8c853d4dbb0d.tar.gz
UXP-5a1843c9f9e323627f9c35529e6a8c853d4dbb0d.tar.lz
UXP-5a1843c9f9e323627f9c35529e6a8c853d4dbb0d.tar.xz
UXP-5a1843c9f9e323627f9c35529e6a8c853d4dbb0d.zip
Merge pull request #1 from MoonchildProductions/master
keep up with mc
Diffstat (limited to 'services/sync/modules/rest.js')
-rw-r--r--services/sync/modules/rest.js18
1 files changed, 17 insertions, 1 deletions
diff --git a/services/sync/modules/rest.js b/services/sync/modules/rest.js
index 94c096dba..106ece222 100644
--- a/services/sync/modules/rest.js
+++ b/services/sync/modules/rest.js
@@ -28,6 +28,21 @@ SyncStorageRequest.prototype = {
_logName: "Sync.StorageRequest",
/**
+ * The string to use as the base User-Agent in Sync requests.
+ * These strings will look something like
+ *
+ * Firefox/4.0 FxSync/1.8.0.20100101.mobile
+ *
+ * or
+ *
+ * Firefox Aurora/5.0a1 FxSync/1.9.0.20110409.desktop
+ */
+ userAgent:
+ Services.appinfo.name + "/" + Services.appinfo.version + // Product.
+ " FxSync/" + WEAVE_VERSION + "." + // Sync.
+ Services.appinfo.appBuildID + ".", // Build.
+
+ /**
* Wait 5 minutes before killing a request.
*/
timeout: STORAGE_REQUEST_TIMEOUT,
@@ -35,7 +50,8 @@ SyncStorageRequest.prototype = {
dispatch: function dispatch(method, data, onComplete, onProgress) {
// Compose a UA string fragment from the various available identifiers.
if (Svc.Prefs.get("sendVersionInfo", true)) {
- this.setHeader("user-agent", Utils.userAgent);
+ let ua = this.userAgent + Svc.Prefs.get("client.type", "desktop");
+ this.setHeader("user-agent", ua);
}
if (this.authenticator) {