#7867 closed bug (wontfix)
JQuery ajax request setting Content-Type to application/x-www-form-urlencoded, regression
Reported by: | 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.
Change History (3)
comment:1 Changed 12 years ago by
Resolution: | → wontfix |
---|---|
Status: | new → closed |
comment:2 follow-up: 3 Changed 12 years ago by
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));
}
});
comment:3 Changed 12 years ago by
Replying to [email protected]…: 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.