Skip to content

Commit

Permalink
transports: added support for xss filters and IE11 UA
Browse files Browse the repository at this point in the history
thanks @3rd-Eden for bringing up ie11
  • Loading branch information
rauchg committed Dec 9, 2013
1 parent b527c75 commit e10ca28
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/transports/polling-jsonp.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ JSONP.prototype.doWrite = function (data) {
// prevent XSS warnings on IE
// https://github.com/LearnBoost/socket.io/pull/1333
var ua = this.req.headers['user-agent'];
if (ua && /;MSIE/.test(ua)) {
if (ua && (~ua.indexOf(';MSIE') || ~ua.indexOf('Trident/'))) {
headers['X-XSS-Protection'] = '0';
}

Expand Down
2 changes: 1 addition & 1 deletion lib/transports/polling-xhr.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ XHR.prototype.doWrite = function (data) {
// prevent XSS warnings on IE
// https://github.com/LearnBoost/socket.io/pull/1333
var ua = this.req.headers['user-agent'];
if (ua && /;MSIE/.test(ua)) {
if (ua && (~ua.indexOf(';MSIE') || ~ua.indexOf('Trident/'))) {
headers['X-XSS-Protection'] = '0';
}

Expand Down

0 comments on commit e10ca28

Please sign in to comment.