Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MINOR Patching prototype.js connection closing to avoid JS errors (se…

…e pull request #106)
  • Loading branch information...
commit 26a6f2e372ac6ef9601a53cac7fadc9ad87ab819 1 parent 86d2c16
@chillu chillu authored
Showing with 6 additions and 5 deletions.
  1. +6 −5 thirdparty/prototype/prototype.js
View
11 thirdparty/prototype/prototype.js
@@ -778,12 +778,13 @@ Ajax.Request.prototype = Object.extend(new Ajax.Base(), {
requestHeaders.push('Content-type',
'application/x-www-form-urlencoded; charset=utf-8');
- /* Force "Connection: close" for Mozilla browsers to work around
- * a bug where XMLHttpReqeuest sends an incorrect Content-length
- * header. See Mozilla Bugzilla #246651.
+ /* Force "Connection: close" for older Mozilla browsers to work
+ * around a bug where XMLHttpRequest sends an incorrect
+ * Content-length header. See Mozilla Bugzilla #246651.
*/
- if (this.transport.overrideMimeType)
- requestHeaders.push('Connection', 'close');
+ if (this.transport.overrideMimeType &&
+ (navigator.userAgent.match(/Gecko\/(\d{4})/) || [0,2005])[1] < 2005)
+ headers['Connection'] = 'close';
}
if (this.options.requestHeaders)
Please sign in to comment.
Something went wrong with that request. Please try again.