Opened 7 years ago

Closed 7 years ago

#15548 closed defect (fixed)

[regression][patch] dojo.xhr: content-type header is plaintext

Reported by: liucougar Owned by: Bryan Forbes
Priority: blocker Milestone: 1.8
Component: IO Version: 1.7.2
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by liucougar)

with dojo < 1.8, dojo.xhrPost({url:'someurl',content:{key:'value'}}) would set content-type to application/x-www-form-urlencoded

however, with current trunk, plain/text is set in FF, application/xml in IE

a possible fix is:

  • dojo/_base/xhr.js

     
    593593               var options = {
    594594                       method: method,
    595595                       handleAs: "text",
    596                        headers: args.headers,
    597596                       data: ioArgs.query,
    598597                       timeout: args.timeout,
    599598                       sync: args.sync,
    600599                       withCredentials: args.withCredentials,
    601600                       ioArgs: ioArgs
    602601               };
     602               if(args.headers){
     603                       options.headers = args.headers;
     604               }
    603605
    604606               dojo._ioNotifyStart(dfd);
    605607               try{

this is introduced with #15182

Change History (6)

comment:1 Changed 7 years ago by liucougar

Milestone: tbd1.8
Priority: undecidedblocker

comment:2 Changed 7 years ago by liucougar

Summary: dojo.xhr regression: header is plaintext[regression][patch] dojo.xhr: content-type header is plaintext

comment:3 Changed 7 years ago by liucougar

see #15552 for a test case

comment:4 Changed 7 years ago by liucougar

Description: modified (diff)

comment:5 Changed 7 years ago by Bryan Forbes

In [29043]:

Fix masked options to dojo/request/xhr in dojo/_base/xhr. refs #15548 !strict

comment:6 Changed 7 years ago by Bryan Forbes

Resolution: fixed
Status: newclosed

Good catch. Thanks, liucougar!

Note: See TracTickets for help on using tickets.