fixes #74 fallback for findEntryStatus when match is missing or otherwise invalid

This commit is contained in:
Nicholas Palenchar
2019-08-27 21:01:01 -04:00
parent f265046676
commit 1a38f519f4
2 changed files with 11 additions and 0 deletions

View File

@@ -241,6 +241,13 @@
statusCodeRegex: new RegExp(/[5][0-9]+/),
className: 'sv-error-response'
},
{
// this object is a catch-all for when no other objects match and should always be last
name: 'unknown',
statusCodeRegex: new RegExp(/.*/),
className: 'missing-data-response'
}
];
const parseHeaders = xhr => {
const headers = xhr.getAllResponseHeaders().trim().split(/[\r\n]+/);