@bool-ts/core 1.7.11 → 1.7.12
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/hooks/factory.js +5 -0
- package/package.json +1 -1
- package/src/hooks/factory.ts +6 -0
package/dist/hooks/factory.js
CHANGED
|
@@ -616,6 +616,11 @@ export const BoolFactory = async (modules, options) => {
|
|
|
616
616
|
const file = Bun.file(`${staticOption.path}/${url.pathname}`);
|
|
617
617
|
const isFileExists = await file.exists();
|
|
618
618
|
if (isFileExists) {
|
|
619
|
+
if (staticOption.headers) {
|
|
620
|
+
for (const [key, value] of Object.entries(staticOption.headers)) {
|
|
621
|
+
responseHeaders.set(key, value);
|
|
622
|
+
}
|
|
623
|
+
}
|
|
619
624
|
responseHeaders.set("Content-Type", file.type);
|
|
620
625
|
return responseConverter(new Response(await file.arrayBuffer(), {
|
|
621
626
|
status: 200,
|
package/package.json
CHANGED
package/src/hooks/factory.ts
CHANGED
|
@@ -988,6 +988,12 @@ export const BoolFactory = async (
|
|
|
988
988
|
const isFileExists = await file.exists();
|
|
989
989
|
|
|
990
990
|
if (isFileExists) {
|
|
991
|
+
if (staticOption.headers) {
|
|
992
|
+
for (const [key, value] of Object.entries(staticOption.headers)) {
|
|
993
|
+
responseHeaders.set(key, value);
|
|
994
|
+
}
|
|
995
|
+
}
|
|
996
|
+
|
|
991
997
|
responseHeaders.set("Content-Type", file.type);
|
|
992
998
|
|
|
993
999
|
return responseConverter(
|