@dnax/core 0.45.0 → 0.45.2
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/app/hono.ts +9 -0
- package/package.json +1 -1
- package/types/index.ts +2 -0
package/app/hono.ts
CHANGED
|
@@ -720,6 +720,7 @@ function HonoInstance(): typeof app {
|
|
|
720
720
|
cleanPath("uploads/" + folder + "/public/"),
|
|
721
721
|
filename
|
|
722
722
|
);
|
|
723
|
+
|
|
723
724
|
const width = parseInt(c.req.query("w")) || null;
|
|
724
725
|
const height = parseInt(c.req.query("h")) || null;
|
|
725
726
|
const quality = parseInt(c.req.query("q")) || 80;
|
|
@@ -731,6 +732,8 @@ function HonoInstance(): typeof app {
|
|
|
731
732
|
|
|
732
733
|
// Obtenir le type MIME du fichier
|
|
733
734
|
const mimeType = mime.lookup(filePath);
|
|
735
|
+
c.header("X-Frame-Options", "ALLOWALL"); // Autoriser tout le monde
|
|
736
|
+
c.header("Content-Security-Policy", "frame-ancestors *"); // Autoriser toutes les origines
|
|
734
737
|
|
|
735
738
|
// Si ce n'est pas une image, retourner le fichier original
|
|
736
739
|
if (!mimeType || !mimeType?.startsWith("image/")) {
|
|
@@ -810,6 +813,12 @@ function HonoInstance(): typeof app {
|
|
|
810
813
|
});
|
|
811
814
|
}
|
|
812
815
|
|
|
816
|
+
app.onError((err, c) => {
|
|
817
|
+
console.error(err?.message);
|
|
818
|
+
c.status(500);
|
|
819
|
+
return c.json({ message: err?.message });
|
|
820
|
+
});
|
|
821
|
+
|
|
813
822
|
return app;
|
|
814
823
|
}
|
|
815
824
|
|
package/package.json
CHANGED