(js) Fix detection of session expiration

This commit is contained in:
Francis Lachapelle
2016-12-01 11:56:07 -05:00
parent c9467e1ce3
commit d2b94eba09
2 changed files with 3 additions and 2 deletions

View File

@@ -243,7 +243,7 @@
response: function(response) {
// When expecting JSON but receiving HTML, assume session has expired and reload page
if (response && /^application\/json/.test(response.config.headers.Accept) &&
/^<!DOCTYPE html>/.test(response.data)) {
/^[\n\r ]*<!DOCTYPE html>/.test(response.data)) {
$window.location.reload(true);
return $q.reject();
}