[jQuery] data: null in $.ajax() settings object results in no Content-length header (FF3)

[jQuery] data: null in $.ajax() settings object results in no Content-length header (FF3)


Just experienced this in Firefox 3, not sure whether it is desired
behavior, but discussed it with a fellow dev and we think it is not.
I had an ajax request as follows:
var myData = null;
$.ajax({
'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. However, 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?