hexo-swpp 2.0.0-beta.2 → 2.0.0-beta.3

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.
Files changed (2) hide show
  1. package/index.js +2 -1
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -45,6 +45,7 @@ if (pluginConfig?.enable) {
45
45
  if (pluginConfig.sw.cdnRacing && getUrlList) {
46
46
  cache +=`
47
47
  const fetchNoCache = request => {
48
+ if (typeof request === 'string') return
48
49
  // noinspection JSUnresolvedFunction
49
50
  const list = getUrlList(request.url)
50
51
  if (!list) return fetch(request, {cache: "no-store"})
@@ -60,7 +61,7 @@ if (pluginConfig?.enable) {
60
61
  cache: "no-store",
61
62
  signal: controller.signal
62
63
  }).then(response => {
63
- if (response.status === 200 || response.status === 301 || response.status === 302) {
64
+ if (response.ok || response.status === 301 || response.status === 302) {
64
65
  controller.abort()
65
66
  return response
66
67
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hexo-swpp",
3
- "version": "2.0.0-beta.2",
3
+ "version": "2.0.0-beta.3",
4
4
  "main": "index.js",
5
5
  "dependencies": {
6
6
  "hexo-log": "^3.0.0",