Ticket #1815 (closed defect: fixed)

Opened 2 years ago

Last modified 1 year ago

Mail composition page is broken with Squid

Reported by: gracinet Assigned to: gracinet
Priority: P2 Milestone: CPS 3.4.4
Component: CPSMailAccess Version: TRUNK
Severity: normal Keywords:
Cc:

Description

When one tries to access the mail composition page: one of the AJAX calls it generates is rejected by Squid, producing a big yellow error in the middle of the page. Here are the headers:

HTTP/1.x 411 Length Required
Date: Wed, 21 Feb 2007 22:29:15 GMT
Server: squid/2.5.STABLE9
Mime-Version: 1.0
Content-Type: text/html
Content-Length: 1946
Expires: Wed, 21 Feb 2007 22:29:15 GMT
X-Squid-Error: ERR_INVALID_REQ 0
X-Cache: MISS from example.com
X-Cache-Lookup: NONE from example.com
Connection: close

This looks rather straightforward: the length is missing. For the sake of completeness, my user agent:

User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; fr; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1

Note that a simple click on the "Save draft" icon cleans the mess and allows the user to actually compose and send the mail.

Change History

02/22/07 00:22:30 changed by gracinet

  • owner changed from tziade to gracinet.

The following patch makes it work.

Index: Products/CPSMailAccess/www/cpsmailaccess.js
===================================================================
--- Products/CPSMailAccess/www/cpsmailaccess.js (revision 50904)
+++ Products/CPSMailAccess/www/cpsmailaccess.js (working copy)
@@ -806,9 +806,10 @@
   {
     url = "hasNotification";
     xml.open("POST", url, false);
+    xml.setRequestHeader("Content-Type", "text/plain");
     try
     {
-      xml.send(null);
+      xml.send("");
     }
     catch(err)
     {

Bottom-line, at least on this version of Firefox, null produces no Content-Length header whereas the empty string does. Squid claims that Content-Length is required for POST, this is probably specified in RFC 2616.

Waiting for IE6 validation before commiting the change.

03/14/07 10:01:22 changed by gracinet

Fixed and commited in branch (by makink it a GET). Waiting for IE6 to merge in trunk

03/14/07 14:39:19 changed by gracinet

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

Works on IE6. Branch checkin was [51328]. Merged in as [51362]

03/20/07 17:45:57 changed by madarche

  • milestone changed from CPS 3.4.5 to CPS 3.4.4.