diff --git a/modules/javascript/src/main/webapp/javascript/atmosphere.js b/modules/javascript/src/main/webapp/javascript/atmosphere.js index e7cf3ac8..08e402ad 100644 --- a/modules/javascript/src/main/webapp/javascript/atmosphere.js +++ b/modules/javascript/src/main/webapp/javascript/atmosphere.js @@ -3085,7 +3085,16 @@ // encodeURI and decodeURI are needed to normalize URL between IE and non-IE, // since IE doesn't encode the href property value and return it - http://jsfiddle.net/Yq9M8/1/ - return encodeURI(decodeURI(div.firstChild.href)); + var ua = window.navigator.userAgent; + if(ua.indexOf('MSIE ')>0 || ua.indexOf('Trident/') > 0 || ua.indexOf('Edge/') > 0){ + return atmosphere.util.fixedEncodeURI(decodeURI(div.firstChild.href)); + } + return div.firstChild.href; + }, + + // Fix IPv6 escaping, see https://github.com/Atmosphere/atmosphere-javascript/pull/243 + fixedEncodeURI: function (str) { + return encodeURI(str).replace(/%5B/g, '[').replace(/%5D/g, ']'); }, prepareURL: function (url) {