Skip to main content

Bug Tracker

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: Owned by:
Priority: undecided Milestone: 1.6
Component: unfiled Version: git
Keywords: Cc:
Blocked by: Blocking:

Difference between two identical POST ajax requests between 1.4.2 and GIT:

macpro:~ sam$ diff /tmp/1.4.2 /tmp/git


Cache-Control: max-age=0


< Accept: application/json, text/javascript, */*

Content-Type: application/x-www-form-urlencoded Accept: application/json, text/javascript, */*; q=0.01


< 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 snover comment:1

resolution: → wontfix
status: newclosed

Set data to null or undefined if you don’t want this to happen.

Changed January 01, 2011 12:37AM UTC by comment:2

data is not set:


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 jitter 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.