Repository: guacamole-client
Updated Branches:
  refs/heads/master 00d464b51 -> 656328149


GUACAMOLE-347: Fix issue with IE missing window.location.origin


Project: http://git-wip-us.apache.org/repos/asf/guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/guacamole-client/commit/6f751702
Tree: http://git-wip-us.apache.org/repos/asf/guacamole-client/tree/6f751702
Diff: http://git-wip-us.apache.org/repos/asf/guacamole-client/diff/6f751702

Branch: refs/heads/master
Commit: 6f7517028ef2de52a204d00be9cb346260b48fdd
Parents: 0611fe8
Author: Nick Couchman <[email protected]>
Authored: Tue Oct 31 13:33:00 2017 -0400
Committer: Nick Couchman <[email protected]>
Committed: Tue Oct 31 13:33:00 2017 -0400

----------------------------------------------------------------------
 .../main/webapp/app/rest/services/tunnelService.js  | 16 ++++++++++++++--
 .../main/webapp/app/rest/types/UserCredentials.js   |  8 +++++++-
 2 files changed, 21 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/6f751702/guacamole/src/main/webapp/app/rest/services/tunnelService.js
----------------------------------------------------------------------
diff --git a/guacamole/src/main/webapp/app/rest/services/tunnelService.js 
b/guacamole/src/main/webapp/app/rest/services/tunnelService.js
index f74088d..6a4840c 100644
--- a/guacamole/src/main/webapp/app/rest/services/tunnelService.js
+++ b/guacamole/src/main/webapp/app/rest/services/tunnelService.js
@@ -189,8 +189,14 @@ angular.module('rest').factory('tunnelService', 
['$injector',
      */
     service.downloadStream = function downloadStream(tunnel, stream, mimetype, 
filename) {
 
+        // Work-around for IE missing window.location.origin
+        if (!$window.location.origin)
+            var streamOrigin = $window.location.protocol + '//' + 
$window.location.hostname + ($window.location.port ? (':' + 
$window.location.port) : '');
+        else
+            var streamOrigin = $window.location.origin;
+
         // Build download URL
-        var url = $window.location.origin
+        var url = streamOrigin
                 + $window.location.pathname
                 + 'api/session/tunnels/' + encodeURIComponent(tunnel)
                 + '/streams/' + encodeURIComponent(stream.index)
@@ -267,8 +273,14 @@ angular.module('rest').factory('tunnelService', 
['$injector',
 
         var deferred = $q.defer();
 
+        // Work-around for IE missing window.location.origin
+        if (!$window.location.origin)
+            var streamOrigin = $window.location.protocol + '//' + 
$window.location.hostname + ($window.location.port ? (':' + 
$window.location.port) : '');
+        else
+            var streamOrigin = $window.location.origin;
+
         // Build upload URL
-        var url = $window.location.origin
+        var url = streamOrigin
                 + $window.location.pathname
                 + 'api/session/tunnels/' + encodeURIComponent(tunnel)
                 + '/streams/' + encodeURIComponent(stream.index)

http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/6f751702/guacamole/src/main/webapp/app/rest/types/UserCredentials.js
----------------------------------------------------------------------
diff --git a/guacamole/src/main/webapp/app/rest/types/UserCredentials.js 
b/guacamole/src/main/webapp/app/rest/types/UserCredentials.js
index ddf9eaf..dc6c75e 100644
--- a/guacamole/src/main/webapp/app/rest/types/UserCredentials.js
+++ b/guacamole/src/main/webapp/app/rest/types/UserCredentials.js
@@ -114,8 +114,14 @@ angular.module('rest').factory('UserCredentials', 
['$injector', function defineU
      */
     UserCredentials.getLink = function getLink(userCredentials) {
 
+        // Work-around for IE missing window.location.origin
+        if (!$window.location.origin)
+            var linkOrigin = $window.location.protocol + '//' + 
$window.location.hostname + ($window.location.port ? (':' + 
$window.location.port) : '');
+        else
+            var linkOrigin = $window.location.origin;
+
         // Build base link
-        var link = $window.location.origin
+        var link = linkOrigin
                  + $window.location.pathname
                  + '#/';
 

Reply via email to