Skip to main content

Bug Tracker

Side navigation

#6674 closed bug (fixed)

Opened June 15, 2010 04:36PM UTC

Closed September 24, 2010 09:56PM UTC

GET request sends Content-Type header when data on URI

Reported by: harbulot Owned by:
Priority: undecided Milestone: 1.4.3
Component: ajax Version: 1.4.2
Keywords: Cc:
Blocked by: Blocking:


The fix for ticket #4183 (between 1.3.2 and 1.4) implies that GET and HEAD ajax requests send a 'Content-Type' header when they should not, since these methods do not have a message-body.

Some servers refuse GET requests with a Content-Type header.

The problem is around line 352 in


if ( || origSettings && origSettings.contentType ) {
        xhr.setRequestHeader("Content-Type", s.contentType);

A fix could be:

if ( ( && type !== "GET" && type != "HEAD") || origSettings && origSettings.contentType ) {
        xhr.setRequestHeader("Content-Type", s.contentType);

Best wishes,


Attachments (0)
Change History (3)

Changed June 15, 2010 04:49PM UTC by harbulot comment:1

I forgot to say that, if I specify

"contentType": null
explicitly as a parameter to
, Firefox does not send the
header, but Opera does (
Content-Type: null
, so the problem remains.

Changed September 15, 2010 03:03AM UTC by dmethvin comment:2

See also #6811.

Changed September 24, 2010 09:56PM UTC by john comment:3

priority: → undecided
resolution: → fixed
status: newclosed