Skip to main content

Bug Tracker

Side navigation

#4664 closed bug (duplicate)

Opened May 15, 2009 08:35PM UTC

Closed May 16, 2009 03:19AM UTC

$.ajax() WITH null data property in config object results in missing Content-Length header in FF3

Reported by: rmurphey Owned by:
Priority: minor Milestone: 1.4
Component: ajax Version: 1.3.2
Keywords: Cc:
Blocked by: Blocking:

(See the full thread at

I had an ajax request as follows:

var myData = null;

  'url' : 'foo.php',
  'data' : myData,
  'type' : 'POST',
  'dataType' : 'json',
  'success' : function(j) {
    // whatever


Client was reporting a 411 HTTP response code on the request -- their proxy was expecting a Content-Length header on the request, and wasn't getting one. This also occurred if myData was undefined. It did *not* occur when myData was {}.

We hadn't detected this error internally because our requests weren't proxy'd. It seems Content-Length "should" always be there

and should be 0 if myData is null or undefined.

I'm not sure whether this is just a Firefox issue, or something that jQuery should address in the spirit of abstracting away browser differences?

Attachments (0)
Change History (1)

Changed May 16, 2009 03:19AM UTC by dmethvin comment:1

resolution: → duplicate
status: newclosed

Dup of #4044.