Skip to content

Commit 4fa7c24

Browse files
committed
fix error if x-powered-by is null
1 parent c5d2b98 commit 4fa7c24

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

background.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function getJsonResource(tabID) {
4747
xhr.open('GET', jsonResourceURL, true);
4848
xhr.onreadystatechange = function() {
4949
if (xhr.readyState !== 4) return; //quickly return if not complete request
50-
var xpbHeader = xhr.getResponseHeader('X-Powered-By');
50+
var xpbHeader = xhr.getResponseHeader('X-Powered-By') || 'unknown';
5151
if (!xpbHeader.match(/Solidus/i)) { //quickly return if not solidus
5252
notifyDevtools('error', 'No Solidus header detected.');
5353
notifyDevtools('status', '<b>not</b> running Solidus 0.1.7 or greater');
@@ -67,6 +67,8 @@ function getJsonResource(tabID) {
6767
} catch (e) {
6868
notifyDevtools('error', e);
6969
}
70+
} else {
71+
notifyDevtools('status', 'what' + xhr.status);
7072
}
7173
};
7274
xhr.send();

0 commit comments

Comments
 (0)