@holo-js/adapter-nuxt 0.1.5 → 0.1.7

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.
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@holo-js/adapter-nuxt",
3
3
  "configKey": "@holo-js/adapter-nuxt",
4
- "version": "0.1.5",
4
+ "version": "0.1.7",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "unknown"
@@ -70,6 +70,27 @@ function resolveContentType(absolutePath) {
70
70
  return "application/octet-stream";
71
71
  }
72
72
  }
73
+ function isActiveContentPath(absolutePath) {
74
+ switch (extname(absolutePath).toLowerCase()) {
75
+ case ".html":
76
+ case ".js":
77
+ case ".mjs":
78
+ case ".svg":
79
+ return true;
80
+ default:
81
+ return false;
82
+ }
83
+ }
84
+ function setStorageResponseHeaders(event, absolutePath) {
85
+ if (isActiveContentPath(absolutePath)) {
86
+ setResponseHeader(event, "content-disposition", "attachment");
87
+ setResponseHeader(event, "content-type", "application/octet-stream");
88
+ setResponseHeader(event, "x-content-type-options", "nosniff");
89
+ return;
90
+ }
91
+ setResponseHeader(event, "content-type", resolveContentType(absolutePath));
92
+ setResponseHeader(event, "x-content-type-options", "nosniff");
93
+ }
73
94
  function createMissingFileError(message) {
74
95
  const error = new Error(message);
75
96
  error.code = "ENOENT";
@@ -95,7 +116,7 @@ async function readPublicFile(event, disk, absolutePath) {
95
116
  throw createMissingFileError("Storage file not found.");
96
117
  }
97
118
  const contents = await file.readFile();
98
- setResponseHeader(event, "content-type", resolveContentType(absolutePath));
119
+ setStorageResponseHeaders(event, absolutePath);
99
120
  return contents;
100
121
  } finally {
101
122
  await file.close();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@holo-js/adapter-nuxt",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "description": "Holo-JS Framework - Nuxt adapter",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -35,16 +35,16 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "@nuxt/kit": "^4.4.4",
38
- "@holo-js/config": "^0.1.5",
39
- "@holo-js/core": "^0.1.5",
40
- "@holo-js/db": "^0.1.5",
41
- "@holo-js/validation": "^0.1.5",
38
+ "@holo-js/config": "^0.1.7",
39
+ "@holo-js/core": "^0.1.7",
40
+ "@holo-js/db": "^0.1.7",
41
+ "@holo-js/validation": "^0.1.7",
42
42
  "h3": "^1.15.11"
43
43
  },
44
44
  "peerDependencies": {
45
- "@holo-js/forms": "^0.1.5",
46
- "@holo-js/storage": "^0.1.5",
47
- "@holo-js/storage-s3": "^0.1.5"
45
+ "@holo-js/forms": "^0.1.7",
46
+ "@holo-js/storage": "^0.1.7",
47
+ "@holo-js/storage-s3": "^0.1.7"
48
48
  },
49
49
  "peerDependenciesMeta": {
50
50
  "@holo-js/forms": {
@@ -58,7 +58,7 @@
58
58
  }
59
59
  },
60
60
  "devDependencies": {
61
- "@holo-js/storage-s3": "^0.1.5",
61
+ "@holo-js/storage-s3": "^0.1.7",
62
62
  "@nuxt/module-builder": "^1.0.2",
63
63
  "@types/node": "^22.10.2",
64
64
  "nuxt": "^4.4.4",