From d4760452d14252854aad29fe4d0919a5d7d83fec Mon Sep 17 00:00:00 2001 From: lilia Date: Fri, 4 Dec 2015 10:45:53 -0800 Subject: [PATCH] Add signal agent to server requests // FREEBIE --- js/libtextsecure.js | 5 ++++- libtextsecure/api.js | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/js/libtextsecure.js b/js/libtextsecure.js index b66fe27e..324aace1 100644 --- a/js/libtextsecure.js +++ b/js/libtextsecure.js @@ -36305,6 +36305,8 @@ var TextSecureServer = (function() { if (options.contentType) { xhr.setRequestHeader( "Content-Type", options.contentType ); } + xhr.setRequestHeader( 'X-Signal-Agent', 'OWD' ); + xhr.onload = function() { var result = xhr.response; @@ -36618,13 +36620,14 @@ var TextSecureServer = (function() { .replace('http://', 'ws://') + '/v1/websocket/?login=' + encodeURIComponent(this.username) + '&password=' + encodeURIComponent(this.password) + + '&agent=OWD' ); }, getProvisioningSocket: function () { return new WebSocket( this.url.replace('https://', 'wss://') .replace('http://', 'ws://') - + '/v1/websocket/provisioning/' + + '/v1/websocket/provisioning/?agent=OWD' ); } }; diff --git a/libtextsecure/api.js b/libtextsecure/api.js index a72161d5..9fb295e9 100644 --- a/libtextsecure/api.js +++ b/libtextsecure/api.js @@ -40,6 +40,8 @@ var TextSecureServer = (function() { if (options.contentType) { xhr.setRequestHeader( "Content-Type", options.contentType ); } + xhr.setRequestHeader( 'X-Signal-Agent', 'OWD' ); + xhr.onload = function() { var result = xhr.response; @@ -353,13 +355,14 @@ var TextSecureServer = (function() { .replace('http://', 'ws://') + '/v1/websocket/?login=' + encodeURIComponent(this.username) + '&password=' + encodeURIComponent(this.password) + + '&agent=OWD' ); }, getProvisioningSocket: function () { return new WebSocket( this.url.replace('https://', 'wss://') .replace('http://', 'ws://') - + '/v1/websocket/provisioning/' + + '/v1/websocket/provisioning/?agent=OWD' ); } };