Bug Tracker

Opened 12 years ago

Closed 9 years ago

Last modified 8 years ago

#2960 closed bug (fixed)

jQuery sends wrong content type to server on ajax post requests if data is {}

Reported by: barushev Owned by:
Priority: major Milestone: 1.4.3
Component: ajax Version: 1.2.5
Keywords: content-type Cc:
Blocked by: Blocking:

Description

Small testcase:

$.post('/index')

no Content-Type and Content-Length headers
$.post('/index', null)

no Content-Type and Content-Length headers
$.post('/index', {'test': 'test'})

Content-Type	application/x-www-form-urlencoded
Content-Length	9
$.post('/index', {})

Content-Length	0
Content-Type	application/xml
$.post('/index', function () {})

Content-Length	0
Content-Type	application/xml

It's wrong Content-type application/xml in last two exaples.

---

Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.14) Gecko/20080419 Ubuntu/8.04 (hardy) Firefox/2.0.0.14

Change History (2)

comment:1 Changed 10 years ago by dmethvin

Milestone: 1.31.4.3

comment:2 Changed 9 years ago by dmethvin

Resolution: fixed
Status: newclosed

I think the final problems should have been fixed for 1.4.3 in this commit:

http://github.com/jquery/jquery/commit/c4e653237f258ce618ad5a9ec677917166fbed16

Note: See TracTickets for help on using tickets.