mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-07 13:41:21 +00:00
GUACAMOLE-347: Merge fix for IE lack of window.location.origin.
This commit is contained in:
@@ -189,8 +189,14 @@ angular.module('rest').factory('tunnelService', ['$injector',
|
|||||||
*/
|
*/
|
||||||
service.downloadStream = function downloadStream(tunnel, stream, mimetype, filename) {
|
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
|
// Build download URL
|
||||||
var url = $window.location.origin
|
var url = streamOrigin
|
||||||
+ $window.location.pathname
|
+ $window.location.pathname
|
||||||
+ 'api/session/tunnels/' + encodeURIComponent(tunnel)
|
+ 'api/session/tunnels/' + encodeURIComponent(tunnel)
|
||||||
+ '/streams/' + encodeURIComponent(stream.index)
|
+ '/streams/' + encodeURIComponent(stream.index)
|
||||||
@@ -267,8 +273,14 @@ angular.module('rest').factory('tunnelService', ['$injector',
|
|||||||
|
|
||||||
var deferred = $q.defer();
|
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
|
// Build upload URL
|
||||||
var url = $window.location.origin
|
var url = streamOrigin
|
||||||
+ $window.location.pathname
|
+ $window.location.pathname
|
||||||
+ 'api/session/tunnels/' + encodeURIComponent(tunnel)
|
+ 'api/session/tunnels/' + encodeURIComponent(tunnel)
|
||||||
+ '/streams/' + encodeURIComponent(stream.index)
|
+ '/streams/' + encodeURIComponent(stream.index)
|
||||||
|
@@ -114,8 +114,14 @@ angular.module('rest').factory('UserCredentials', ['$injector', function defineU
|
|||||||
*/
|
*/
|
||||||
UserCredentials.getLink = function getLink(userCredentials) {
|
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
|
// Build base link
|
||||||
var link = $window.location.origin
|
var link = linkOrigin
|
||||||
+ $window.location.pathname
|
+ $window.location.pathname
|
||||||
+ '#/';
|
+ '#/';
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user