@glitchr/transparent 1.0.50 → 1.0.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glitchr/transparent",
3
- "version": "1.0.50",
3
+ "version": "1.0.51",
4
4
  "description": "Transparent SPA Application",
5
5
  "main": "src/index.js",
6
6
  "access": "public",
@@ -1600,11 +1600,22 @@
1600
1600
  }
1601
1601
 
1602
1602
  // Invalid html page returned
1603
- if(!responseText.includes("<html") || !responseText.includes("<body") || !responseText.includes("<head"))
1604
- return Transparent.rescue(dom);
1603
+ if(request && request.getResponseHeader("Content-Type") == "text/html") {
1604
+
1605
+ if (!responseText.includes("<html") && !responseText.includes("<body") && !responseText.includes("<head"))
1606
+ return Transparent.rescue(dom);
1607
+ }
1608
+
1609
+ if(status == 302) {
1605
1610
 
1606
- if(status != 200) // Blatant error received..
1611
+ if(responseURL) location.href = responseURL;
1612
+ else location.reload();
1613
+
1614
+ } else if(status != 200) {
1615
+
1616
+ // Blatant error received..
1607
1617
  return Transparent.rescue(dom);
1618
+ }
1608
1619
 
1609
1620
  // From here the page is valid..
1610
1621
  // so the new page is added to history..