[Pkg-javascript-commits] [dojo] 04/05: Fix bad logic in xhr that tries to avoid double-setting Content-Type

David Prévot taffit at moszumanska.debian.org
Tue Dec 9 17:50:38 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to annotated tag 1.6.3
in repository dojo.

commit 31ff515bdaa7f23a0907cf88862e3207b1289116
Author: Colin Snover <github.com at zetafleet.com>
Date:   Sat Aug 23 05:42:28 2014 +0000

    Fix bad logic in xhr that tries to avoid double-setting Content-Type
    
    Fixes #18237.
    
    (cherry picked from commit 33e102dfe99c201efdb817931167261cf4985e9b)
---
 _base/xhr.js | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/_base/xhr.js b/_base/xhr.js
index fc3c04e..565f9da 100644
--- a/_base/xhr.js
+++ b/_base/xhr.js
@@ -857,8 +857,10 @@ define("dojo/_base/xhr", ["dojo/lib/kernel", "dojo/_base/Deferred", "dojo/_base/
 		xhr.open(method, ioArgs.url, args.sync !== true, args.user || undefined, args.password || undefined);
 		if(args.headers){
 			for(var hdr in args.headers){
-				if(hdr.toLowerCase() === "content-type" && !args.contentType){
-					args.contentType = args.headers[hdr];
+				if(hdr.toLowerCase() === "content-type"){
+					if(!args.contentType){
+						args.contentType = args.headers[hdr];
+					}
 				}else if(args.headers[hdr]){
 					//Only add header if it has a value. This allows for instnace, skipping
 					//insertion of X-Requested-With by specifying empty value.

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/dojo.git



More information about the Pkg-javascript-commits mailing list