incubator-xap-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmarga...@apache.org
Subject svn commit: r453008 - /incubator/xap/trunk/src/xap/util/HttpUtils.js
Date Wed, 04 Oct 2006 20:23:09 GMT
Author: jmargaris
Date: Wed Oct  4 13:23:08 2006
New Revision: 453008

URL: http://svn.apache.org/viewvc?view=rev&rev=453008
Log:
IE doesn't seem to like setting blank headers, and null
check is dangerous

Modified:
    incubator/xap/trunk/src/xap/util/HttpUtils.js

Modified: incubator/xap/trunk/src/xap/util/HttpUtils.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/util/HttpUtils.js?view=diff&rev=453008&r1=453007&r2=453008
==============================================================================
--- incubator/xap/trunk/src/xap/util/HttpUtils.js (original)
+++ incubator/xap/trunk/src/xap/util/HttpUtils.js Wed Oct  4 13:23:08 2006
@@ -54,15 +54,17 @@
 	var request = xap.util.HttpUtils.createHttpRequest();
 	var isHttpRequestType = typeof url == "object" && url.constructor == xap.requestservice.HttpRequest;
 	if (isHttpRequestType) {
-		request.open(url.getRequestMethod() || type, url.getUri(), callback != null);
+		request.open(url.getRequestMethod() || type, url.getUri(), callback?true:false);
 		var headerNames = url.getHeaderNames();
 		for (var i = 0; i < headerNames.length; i++) {
 			var headerName = headerNames[i];
-			request.setRequestHeader(headerName, url.getHeader(headerName));
-			xap.util.HttpUtils.s_log.warn(headerName + " ==> " + url.getHeader(headerName));
+			var headerValue = url.getHeader(headerName);
+			if (headerValue){
+				request.setRequestHeader(headerName, headerValue);
+			}
 		}
 	} else {
-		request.open(type, url, callback != null);
+		request.open(type, url, callback?true:false);
 	}
 	if (callback) {
 		request.onreadystatechange = function () {



Mime
View raw message