Modify ↓
Ticket #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: | |
| Blocking: | Blocked by: |
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
comment:2 Changed 3 years ago by dmethvin
- Status changed from new to closed
- Resolution set to fixed
I think the final problems should have been fixed for 1.4.3 in this commit:
http://github.com/jquery/jquery/commit/c4e653237f258ce618ad5a9ec677917166fbed16
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.
