You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xap-commits@incubator.apache.org by jm...@apache.org on 2006/10/04 20:23:09 UTC
svn commit: r453008 - /incubator/xap/trunk/src/xap/util/HttpUtils.js
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 () {