summaryrefslogtreecommitdiffabout
path: root/src/components/xriProtocolHandler.js
Side-by-side diff
Diffstat (limited to 'src/components/xriProtocolHandler.js') (more/less context) (ignore whitespace changes)
-rwxr-xr-xsrc/components/xriProtocolHandler.js10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/components/xriProtocolHandler.js b/src/components/xriProtocolHandler.js
index 7046cde..1105874 100755
--- a/src/components/xriProtocolHandler.js
+++ b/src/components/xriProtocolHandler.js
@@ -306,25 +306,25 @@ function renderService(srv, doc, qxri)
function isKnownServiceType(type)
{
if (type.toLowerCase() in SERVICE_CLASSES) {
return true;
}
return false;
}
function getServiceClass(type)
{
- if (isKnownServiceType(type)) {
+ if (type && isKnownServiceType(type)) {
return SERVICE_CLASSES[type.toLowerCase()];
}
return type;
}
function guessServiceTypeByURI(uri)
{
if (uri == null || uri == "") {
return "unknown";
}
if (uri.match(/^https?:/i)) {
@@ -788,61 +788,59 @@ XRIChannel.prototype = {
// these nsIRequest attributes must be copied to the stub
// channel that we created
channel.notificationCallbacks = this.notificationCallbacks;
channel.loadGroup = this.loadGroup;
channel.loadFlags = this.loadFlags;
this.mChannel = channel;
channel.asyncOpen(this, null);
},
-/* public fields (nsIChannel implmentation) */
+/* public fields (nsIChannel implementation) */
allowPipelining: false,
redirectionLimit: 5,
referrer: "",
requestMethod: "GET",
requestSucceeded: true,
responseStatus: 200,
responseStatusText: "OK",
getRequestHeader: function(header) {
dump("getRequestHeader(" + header + ")\n");
var httpChannel = this.mChannel.QueryInterface(nsIHttpChannel);
try {
var val = httpChannel.getRequestHeader(header);
dump("getRequestHeader(" + header + ") = " + val + "\n");
return val;
}
catch (e) {
+ dump("getRequestHeader - got exception: " + e + "\n");
throw e;
}
},
getResponseHeader: function(header) {
dump("getResponseHeader(" + header + ")\n");
var httpChannel = this.mChannel.QueryInterface(nsIHttpChannel);
try {
var val = httpChannel.getResponseHeader(header);
dump("getResponseHeader(" + header + ") = " + val + "\n");
return val;
}
catch (e) {
+ dump("getResponseHeader - got exception: " + e + "\n");
throw e;
}
-/* XXX
- if (header == "Content-Type")
- return "text/html";
-*/
return null;
},
isNoCacheResponse: function() {
dump("isNoCacheResponse()\n");
var httpChannel = this.mChannel.QueryInterface(nsIHttpChannel);
return httpChannel.isNoCacheResponse();
},
isNoStoreResponse: function() {
dump("isNoStoreResponse()\n");
var httpChannel = this.mChannel.QueryInterface(nsIHttpChannel);
return httpChannel.isNoStoreResponse();
return true;