author | williamt <williamt> | 2007-01-05 10:10:55 (UTC) |
---|---|---|
committer | williamt <williamt> | 2007-01-05 10:10:55 (UTC) |
commit | d85adfb349b3c7a988bec21fcbad86f5f98c70de (patch) (unidiff) | |
tree | b0bff7d20e03d2e4ba4bfb3309059930006ab927 /src/components | |
parent | c4b3096e166a0a9a60fd27c8f2dc06e688f13172 (diff) | |
download | foxri-d85adfb349b3c7a988bec21fcbad86f5f98c70de.zip foxri-d85adfb349b3c7a988bec21fcbad86f5f98c70de.tar.gz foxri-d85adfb349b3c7a988bec21fcbad86f5f98c70de.tar.bz2 |
* Updated for Firefox 2REL_1_1_2upstream/master
-rwxr-xr-x | src/components/xriProtocolHandler.js | 10 |
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 | |||
@@ -302,33 +302,33 @@ function renderService(srv, doc, qxri) | |||
302 | 302 | ||
303 | return html; | 303 | return html; |
304 | } | 304 | } |
305 | 305 | ||
306 | 306 | ||
307 | 307 | ||
308 | function isKnownServiceType(type) | 308 | function isKnownServiceType(type) |
309 | { | 309 | { |
310 | if (type.toLowerCase() in SERVICE_CLASSES) { | 310 | if (type.toLowerCase() in SERVICE_CLASSES) { |
311 | return true; | 311 | return true; |
312 | } | 312 | } |
313 | return false; | 313 | return false; |
314 | } | 314 | } |
315 | 315 | ||
316 | function getServiceClass(type) | 316 | function getServiceClass(type) |
317 | { | 317 | { |
318 | if (isKnownServiceType(type)) { | 318 | if (type && isKnownServiceType(type)) { |
319 | return SERVICE_CLASSES[type.toLowerCase()]; | 319 | return SERVICE_CLASSES[type.toLowerCase()]; |
320 | } | 320 | } |
321 | return type; | 321 | return type; |
322 | } | 322 | } |
323 | 323 | ||
324 | 324 | ||
325 | function guessServiceTypeByURI(uri) | 325 | function guessServiceTypeByURI(uri) |
326 | { | 326 | { |
327 | if (uri == null || uri == "") { | 327 | if (uri == null || uri == "") { |
328 | return "unknown"; | 328 | return "unknown"; |
329 | } | 329 | } |
330 | if (uri.match(/^https?:/i)) { | 330 | if (uri.match(/^https?:/i)) { |
331 | return "www"; | 331 | return "www"; |
332 | } | 332 | } |
333 | else if (uri.match(/^skype:/i)) { | 333 | else if (uri.match(/^skype:/i)) { |
334 | return "skype"; | 334 | return "skype"; |
@@ -784,69 +784,67 @@ XRIChannel.prototype = { | |||
784 | dump("loadFlags = " + this.loadFlags + "\n"); | 784 | dump("loadFlags = " + this.loadFlags + "\n"); |
785 | dump("loadGroup = " + this.loadGroup + "\n"); | 785 | dump("loadGroup = " + this.loadGroup + "\n"); |
786 | dump("owner = " + this.owner + "\n"); | 786 | dump("owner = " + this.owner + "\n"); |
787 | dump("securityInfo = " + this.securityInfo + "\n"); | 787 | dump("securityInfo = " + this.securityInfo + "\n"); |
788 | 788 | ||
789 | // these nsIRequest attributes must be copied to the stub | 789 | // these nsIRequest attributes must be copied to the stub |
790 | // channel that we created | 790 | // channel that we created |
791 | channel.notificationCallbacks = this.notificationCallbacks; | 791 | channel.notificationCallbacks = this.notificationCallbacks; |
792 | channel.loadGroup = this.loadGroup; | 792 | channel.loadGroup = this.loadGroup; |
793 | channel.loadFlags = this.loadFlags; | 793 | channel.loadFlags = this.loadFlags; |
794 | 794 | ||
795 | this.mChannel = channel; | 795 | this.mChannel = channel; |
796 | channel.asyncOpen(this, null); | 796 | channel.asyncOpen(this, null); |
797 | }, | 797 | }, |
798 | 798 | ||
799 | 799 | ||
800 | /* public fields (nsIChannel implmentation) */ | 800 | /* public fields (nsIChannel implementation) */ |
801 | allowPipelining: false, | 801 | allowPipelining: false, |
802 | redirectionLimit: 5, | 802 | redirectionLimit: 5, |
803 | referrer: "", | 803 | referrer: "", |
804 | requestMethod: "GET", | 804 | requestMethod: "GET", |
805 | requestSucceeded: true, | 805 | requestSucceeded: true, |
806 | responseStatus: 200, | 806 | responseStatus: 200, |
807 | responseStatusText: "OK", | 807 | responseStatusText: "OK", |
808 | getRequestHeader: function(header) { | 808 | getRequestHeader: function(header) { |
809 | dump("getRequestHeader(" + header + ")\n"); | 809 | dump("getRequestHeader(" + header + ")\n"); |
810 | var httpChannel = this.mChannel.QueryInterface(nsIHttpChannel); | 810 | var httpChannel = this.mChannel.QueryInterface(nsIHttpChannel); |
811 | 811 | ||
812 | try { | 812 | try { |
813 | var val = httpChannel.getRequestHeader(header); | 813 | var val = httpChannel.getRequestHeader(header); |
814 | dump("getRequestHeader(" + header + ") = " + val + "\n"); | 814 | dump("getRequestHeader(" + header + ") = " + val + "\n"); |
815 | return val; | 815 | return val; |
816 | } | 816 | } |
817 | catch (e) { | 817 | catch (e) { |
818 | dump("getRequestHeader - got exception: " + e + "\n"); | ||
818 | throw e; | 819 | throw e; |
819 | } | 820 | } |
820 | }, | 821 | }, |
821 | getResponseHeader: function(header) { | 822 | getResponseHeader: function(header) { |
822 | dump("getResponseHeader(" + header + ")\n"); | 823 | dump("getResponseHeader(" + header + ")\n"); |
823 | var httpChannel = this.mChannel.QueryInterface(nsIHttpChannel); | 824 | var httpChannel = this.mChannel.QueryInterface(nsIHttpChannel); |
824 | 825 | ||
825 | try { | 826 | try { |
826 | var val = httpChannel.getResponseHeader(header); | 827 | var val = httpChannel.getResponseHeader(header); |
827 | dump("getResponseHeader(" + header + ") = " + val + "\n"); | 828 | dump("getResponseHeader(" + header + ") = " + val + "\n"); |
828 | return val; | 829 | return val; |
829 | } | 830 | } |
830 | catch (e) { | 831 | catch (e) { |
832 | dump("getResponseHeader - got exception: " + e + "\n"); | ||
831 | throw e; | 833 | throw e; |
832 | } | 834 | } |
833 | /* XXX | ||
834 | if (header == "Content-Type") | ||
835 | return "text/html"; | ||
836 | */ | ||
837 | return null; | 835 | return null; |
838 | }, | 836 | }, |
839 | isNoCacheResponse: function() { | 837 | isNoCacheResponse: function() { |
840 | dump("isNoCacheResponse()\n"); | 838 | dump("isNoCacheResponse()\n"); |
841 | var httpChannel = this.mChannel.QueryInterface(nsIHttpChannel); | 839 | var httpChannel = this.mChannel.QueryInterface(nsIHttpChannel); |
842 | return httpChannel.isNoCacheResponse(); | 840 | return httpChannel.isNoCacheResponse(); |
843 | }, | 841 | }, |
844 | isNoStoreResponse: function() { | 842 | isNoStoreResponse: function() { |
845 | dump("isNoStoreResponse()\n"); | 843 | dump("isNoStoreResponse()\n"); |
846 | var httpChannel = this.mChannel.QueryInterface(nsIHttpChannel); | 844 | var httpChannel = this.mChannel.QueryInterface(nsIHttpChannel); |
847 | return httpChannel.isNoStoreResponse(); | 845 | return httpChannel.isNoStoreResponse(); |
848 | return true; | 846 | return true; |
849 | }, | 847 | }, |
850 | setRequestHeader: function(header, value, merge) { | 848 | setRequestHeader: function(header, value, merge) { |
851 | dump("setRequestHeader(" + header + ", " + value + ")\n"); | 849 | dump("setRequestHeader(" + header + ", " + value + ")\n"); |
852 | var httpChannel = this.mChannel.QueryInterface(nsIHttpChannel); | 850 | var httpChannel = this.mChannel.QueryInterface(nsIHttpChannel); |