Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #5809 (closed defect: duplicate)

Opened 3 years ago

Last modified 3 years ago

[PATCH] Mozilla NTLM authentication fails on Prototype XMLHttpRequest POST

Reported by: wjrogers@terpalum.umd.edu Assigned to: sam
Priority: normal Milestone:
Component: Prototype Version:
Severity: normal Keywords:
Cc:

Description

Prototype contains a work-around for an old Mozilla bug that sets a "Connection: close" header on XMLHttpRequest POSTs. The Mozilla bug this work-around is for was fixed in Firefox 1.5.

The "Connection: close" header causes NTLM (Windows) authentication to fail, because the challenge-response sequence requires keep-alive. Below is a patch that removes the work-around from Prototype. I assume this will cause whatever problem the work-around was originally designed to fix to reappear in Firefox versions < 1.5. I'll leave it up to the core team to decide whether to introduce some User-Agent detection to preserve the work-around code for legacy Firefox clients.

See also:

Mozilla #246651 - the bug the work-around was designed for (fixed)
Mozilla #331210 - the bug caused by the work-around (see the last few comments)

Index: src/ajax.js
===================================================================
--- src/ajax.js	(revision 4745)
+++ src/ajax.js	(working copy)
@@ -120,13 +120,6 @@
 
     if (this.options.method == 'post') {
       requestHeaders.push('Content-type', this.options.contentType);
-
-      /* Force "Connection: close" for Mozilla browsers to work around
-       * a bug where XMLHttpReqeuest sends an incorrect Content-length
-       * header. See Mozilla Bugzilla #246651. 
-       */
-      if (this.transport.overrideMimeType)
-        requestHeaders.push('Connection', 'close');
     }
 
     if (this.options.requestHeaders)

Change History

08/31/06 09:16:57 changed by anonymous

On a parallel note, I wonder whether the workaround introduced by Prototype has any impact on performance for servers that rely on keep-alive to improve network latency.

11/04/06 20:44:49 changed by mislav

  • status changed from new to closed.
  • resolution set to duplicate.

see #5606