Kaynağa Gözat

auto-retry on 403 only

Gildas 7 yıl önce
ebeveyn
işleme
3e51e5d293
1 değiştirilmiş dosya ile 5 ekleme ve 5 silme
  1. 5 5
      lib/fetch/content/fetch.js

+ 5 - 5
lib/fetch/content/fetch.js

@@ -26,19 +26,19 @@ this.superFetch = this.superFetch || (() => {
 		fetch: async url => {
 			try {
 				let response = await fetch(url, { cache: "force-cache" });
-				if (response.status >= 400) {
+				if (response.status == 403) {
 					response = await fetch(url, { credentials: "same-origin", cache: "force-cache" });
 				}
-				if (response.status >= 400) {
+				if (response.status == 403) {
 					response = await fetch(url, { credentials: "include", cache: "force-cache" });
 				}
-				if (response.status >= 400) {
+				if (response.status == 403) {
 					response = await fetch(url, { mode: "cors", credentials: "omit", cache: "force-cache" });
 				}
-				if (response.status >= 400) {
+				if (response.status == 403) {
 					response = await fetch(url, { mode: "cors", credentials: "same-origin", cache: "force-cache" });
 				}
-				if (response.status >= 400) {
+				if (response.status == 403) {
 					response = await fetch(url, { mode: "cors", credentials: "include", cache: "force-cache" });
 				}
 				return response;