miniflare
Advanced tools
Comparing version 3.20240419.1 to 3.20240512.0
@@ -18,2 +18,60 @@ // ../../node_modules/.pnpm/kleur@4.1.5/node_modules/kleur/colors.mjs | ||
// src/shared/mime-types.ts | ||
var compressedByCloudflareFL = /* @__PURE__ */ new Set([ | ||
// list copied from https://developers.cloudflare.com/speed/optimization/content/brotli/content-compression/#:~:text=If%20supported%20by%20visitors%E2%80%99%20web%20browsers%2C%20Cloudflare%20will%20return%20Gzip%20or%20Brotli%2Dencoded%20responses%20for%20the%20following%20content%20types%3A | ||
"text/html", | ||
"text/richtext", | ||
"text/plain", | ||
"text/css", | ||
"text/x-script", | ||
"text/x-component", | ||
"text/x-java-source", | ||
"text/x-markdown", | ||
"application/javascript", | ||
"application/x-javascript", | ||
"text/javascript", | ||
"text/js", | ||
"image/x-icon", | ||
"image/vnd.microsoft.icon", | ||
"application/x-perl", | ||
"application/x-httpd-cgi", | ||
"text/xml", | ||
"application/xml", | ||
"application/rss+xml", | ||
"application/vnd.api+json", | ||
"application/x-protobuf", | ||
"application/json", | ||
"multipart/bag", | ||
"multipart/mixed", | ||
"application/xhtml+xml", | ||
"font/ttf", | ||
"font/otf", | ||
"font/x-woff", | ||
"image/svg+xml", | ||
"application/vnd.ms-fontobject", | ||
"application/ttf", | ||
"application/x-ttf", | ||
"application/otf", | ||
"application/x-otf", | ||
"application/truetype", | ||
"application/opentype", | ||
"application/x-opentype", | ||
"application/font-woff", | ||
"application/eot", | ||
"application/font", | ||
"application/font-sfnt", | ||
"application/wasm", | ||
"application/javascript-binast", | ||
"application/manifest+json", | ||
"application/ld+json", | ||
"application/graphql+json", | ||
"application/geo+json" | ||
]); | ||
function isCompressedByCloudflareFL(contentTypeHeader) { | ||
if (!contentTypeHeader) | ||
return !0; | ||
let [contentType] = contentTypeHeader.split(";"); | ||
return compressedByCloudflareFL.has(contentType); | ||
} | ||
// src/workers/core/constants.ts | ||
@@ -899,4 +957,4 @@ var CoreHeaders = { | ||
return response; | ||
let contentEncoding = response.headers.get("Content-Encoding"); | ||
if (contentEncoding !== null && contentEncoding !== "gzip" && contentEncoding !== "br") | ||
let contentEncoding = response.headers.get("Content-Encoding"), contentType = response.headers.get("Content-Type"); | ||
if (!isCompressedByCloudflareFL(contentType) || contentEncoding !== null && contentEncoding !== "gzip" && contentEncoding !== "br") | ||
return response; | ||
@@ -903,0 +961,0 @@ let desiredEncoding, identityDisallowed = !1; |
{ | ||
"name": "miniflare", | ||
"version": "3.20240419.1", | ||
"version": "3.20240512.0", | ||
"description": "Fun, full-featured, fully-local simulator for Cloudflare Workers", | ||
@@ -41,3 +41,3 @@ "keywords": [ | ||
"undici": "^5.28.2", | ||
"workerd": "1.20240419.0", | ||
"workerd": "1.20240512.0", | ||
"ws": "^8.11.0", | ||
@@ -49,3 +49,3 @@ "youch": "^3.2.2", | ||
"@ava/typescript": "^4.0.0", | ||
"@cloudflare/workers-types": "^4.20240419.0", | ||
"@cloudflare/workers-types": "^4.20240512.0", | ||
"@microsoft/api-extractor": "^7.36.3", | ||
@@ -52,0 +52,0 @@ "@types/debug": "^4.1.7", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1604858
31257
+ Added@cloudflare/workerd-darwin-64@1.20240512.0(transitive)
+ Added@cloudflare/workerd-darwin-arm64@1.20240512.0(transitive)
+ Added@cloudflare/workerd-linux-64@1.20240512.0(transitive)
+ Added@cloudflare/workerd-linux-arm64@1.20240512.0(transitive)
+ Added@cloudflare/workerd-windows-64@1.20240512.0(transitive)
+ Addedworkerd@1.20240512.0(transitive)
- Removed@cloudflare/workerd-darwin-64@1.20240419.0(transitive)
- Removed@cloudflare/workerd-darwin-arm64@1.20240419.0(transitive)
- Removed@cloudflare/workerd-linux-64@1.20240419.0(transitive)
- Removed@cloudflare/workerd-linux-arm64@1.20240419.0(transitive)
- Removed@cloudflare/workerd-windows-64@1.20240419.0(transitive)
- Removedworkerd@1.20240419.0(transitive)
Updatedworkerd@1.20240512.0