Side navigation
#7867 closed bug (wontfix)
Opened December 30, 2010 05:22AM UTC
Closed December 31, 2010 11:03PM UTC
Last modified March 13, 2012 11:26PM UTC
JQuery ajax request setting Content-Type to application/x-www-form-urlencoded, regression
Reported by: | spullara@yahoo.com | Owned by: | |
---|---|---|---|
Priority: | undecided | Milestone: | 1.6 |
Component: | unfiled | Version: | git |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Difference between two identical POST ajax requests between 1.4.2 and GIT:
macpro:~ sam$ diff /tmp/1.4.2 /tmp/git
4a5
Cache-Control: max-age=0
6c7,8
< Accept: application/json, text/javascript, */*
Content-Type: application/x-www-form-urlencoded Accept: application/json, text/javascript, */*; q=0.01
8d9
< Cache-Control: max-age=0
I've understood that the Cache-Control one is on purpose, however the Content-Type one was not mentioned. I'm not sending any data and didn't expect a content type to be set since I didn't set one. The content-lenght of the request is 0.
Attachments (0)
Change History (3)
Changed December 31, 2010 11:03PM UTC by comment:1
resolution: | → wontfix |
---|---|
status: | new → closed |
Changed January 01, 2011 12:37AM UTC by comment:2
data is not set:
$.ajax({
url: '/v1/follow/' + follower + '/follows/profile/' + following + '?crumb=' + z + '' + (r ? '&render=' + r : '') + '',
type: 'POST',
dataType: "json",
success: function(d) {
if (success) success(d);
},
error: function(xhr) {
if (failure) failure($.parseJSON(xhr.responseText));
}
});
Changed January 11, 2011 01:05PM UTC by comment:3
Replying to [comment:2 spullara@…]:
I made a live test case which replicates the code you posted but I couldn't reproduce your problem.
Also be aware that AFAIK jQuery doesn't set the Cache-Control header you mentioned. And it also doesn't set the Content-Type header as far as I'm aware if you don't provide any data. So I guess these are headers automatically send by your browser.
Please report back with more information (browser, os, ...) and provide a test case which reproduces your problem and demonstrates this is indeed caused by jQuery.
Set
data
to null or undefined if you don’t want this to happen.