nitropack-nightly 2.13.0-20251216-111546-8e342728 → 2.13.0-20251216-115630-9617490c

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.
@@ -1,4 +1,4 @@
1
- const version = "2.13.0-20251216-111546-8e342728";
1
+ const version = "2.13.0-20251216-115630-9617490c";
2
2
 
3
3
  const compatibilityChanges = [
4
4
  {
@@ -1259,6 +1259,14 @@ function publicAssets(nitro) {
1259
1259
  data: nitro.options.serveStatic === "inline" ? assetData.toString("base64") : void 0
1260
1260
  };
1261
1261
  }
1262
+ for (const key in assets) {
1263
+ if (/\.(gz|br)$/.test(key)) {
1264
+ const originalKey = key.replace(/\.(gz|br)$/, "");
1265
+ if (assets[originalKey] && assets[originalKey].encoding === void 0) {
1266
+ assets[originalKey].encoding = null;
1267
+ }
1268
+ }
1269
+ }
1262
1270
  return `export default ${JSON.stringify(assets, null, 2)};`;
1263
1271
  },
1264
1272
  // #nitro-internal-virtual/public-assets-node
@@ -37,9 +37,6 @@ export default eventHandler((event) => {
37
37
  ...encodingHeader.split(",").map((e) => EncodingMap[e.trim()]).filter(Boolean).sort(),
38
38
  ""
39
39
  ];
40
- if (encodings.length > 1) {
41
- appendResponseHeader(event, "Vary", "Accept-Encoding");
42
- }
43
40
  for (const encoding of encodings) {
44
41
  for (const _id of [id + encoding, joinURL(id, "index.html" + encoding)]) {
45
42
  const _asset = getAsset(_id);
@@ -57,6 +54,9 @@ export default eventHandler((event) => {
57
54
  }
58
55
  return;
59
56
  }
57
+ if (asset.encoding !== void 0) {
58
+ appendResponseHeader(event, "Vary", "Accept-Encoding");
59
+ }
60
60
  const ifNotMatch = getRequestHeader(event, "if-none-match") === asset.etag;
61
61
  if (ifNotMatch) {
62
62
  setResponseStatus(event, 304, "Not Modified");
@@ -38,7 +38,7 @@ interface PublicAsset {
38
38
  mtime: string;
39
39
  path: string;
40
40
  size: number;
41
- encoding?: string;
41
+ encoding?: string | null;
42
42
  data?: string;
43
43
  }
44
44
  interface AssetMeta {
@@ -38,7 +38,7 @@ interface PublicAsset {
38
38
  mtime: string;
39
39
  path: string;
40
40
  size: number;
41
- encoding?: string;
41
+ encoding?: string | null;
42
42
  data?: string;
43
43
  }
44
44
  interface AssetMeta {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nitropack-nightly",
3
- "version": "2.13.0-20251216-111546-8e342728",
3
+ "version": "2.13.0-20251216-115630-9617490c",
4
4
  "description": "Build and Deploy Universal JavaScript Servers",
5
5
  "repository": "nitrojs/nitro",
6
6
  "license": "MIT",