@cloudflare/vite-plugin 1.9.4 → 1.9.6
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.
|
@@ -6184,9 +6184,10 @@ var worker_default = {
|
|
|
6184
6184
|
});
|
|
6185
6185
|
if (shouldBlockNonImageResponse) {
|
|
6186
6186
|
const resp = await env.USER_WORKER.fetch(maybeSecondRequest);
|
|
6187
|
-
const
|
|
6188
|
-
const
|
|
6189
|
-
|
|
6187
|
+
const contentType = resp.headers.get("content-type") || "";
|
|
6188
|
+
const isImageOrPlainText = contentType.startsWith("image/") || // Matches "text/plain", "text/plain;charset=UTF-8"
|
|
6189
|
+
contentType.split(";")[0] === "text/plain";
|
|
6190
|
+
if (!isImageOrPlainText && resp.status !== 304) {
|
|
6190
6191
|
analytics.setData({ abuseMitigationBlocked: true });
|
|
6191
6192
|
return new Response("Blocked", { status: 403 });
|
|
6192
6193
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudflare/vite-plugin",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.6",
|
|
4
4
|
"description": "Cloudflare plugin for Vite",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloudflare",
|
|
@@ -41,26 +41,26 @@
|
|
|
41
41
|
"tinyglobby": "^0.2.12",
|
|
42
42
|
"unenv": "2.0.0-rc.17",
|
|
43
43
|
"ws": "8.18.0",
|
|
44
|
-
"miniflare": "4.
|
|
45
|
-
"wrangler": "4.
|
|
44
|
+
"miniflare": "4.20250712.0",
|
|
45
|
+
"wrangler": "4.25.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@cloudflare/workers-types": "^4.
|
|
48
|
+
"@cloudflare/workers-types": "^4.20250712.0",
|
|
49
49
|
"@types/node": "^22.10.1",
|
|
50
50
|
"@types/ws": "^8.5.13",
|
|
51
51
|
"magic-string": "^0.30.12",
|
|
52
52
|
"mlly": "^1.7.4",
|
|
53
53
|
"tsup": "8.3.0",
|
|
54
|
-
"typescript": "^5.
|
|
54
|
+
"typescript": "^5.8.3",
|
|
55
55
|
"vite": "7.0.0",
|
|
56
56
|
"vitest": "~3.2.0",
|
|
57
|
-
"@cloudflare/workers-shared": "0.18.3",
|
|
58
57
|
"@cloudflare/mock-npm-registry": "0.0.0",
|
|
58
|
+
"@cloudflare/workers-shared": "0.18.4",
|
|
59
59
|
"@cloudflare/workers-tsconfig": "0.0.0"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
62
|
"vite": "^6.1.0 || ^7.0.0",
|
|
63
|
-
"wrangler": "4.
|
|
63
|
+
"wrangler": "^4.25.0"
|
|
64
64
|
},
|
|
65
65
|
"publishConfig": {
|
|
66
66
|
"access": "public"
|