nuxt-og-image 2.0.0-beta.41 → 2.0.0-beta.42
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 +1 -1
- package/dist/module.mjs +16 -0
- package/package.json +1 -1
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -569,6 +569,22 @@ export async function useProvider(provider) {
|
|
|
569
569
|
contents = contents.replace(".cwd(),", '?.cwd || "/",');
|
|
570
570
|
updated = true;
|
|
571
571
|
}
|
|
572
|
+
if (_nitro.options.preset.includes("netlify") && path.endsWith("netlify.mjs")) {
|
|
573
|
+
const match = "// TODO: handle event.isBase64Encoded\n });";
|
|
574
|
+
contents = contents.replace(match, `${match}
|
|
575
|
+
|
|
576
|
+
const headers = normalizeOutgoingHeaders(r.headers);
|
|
577
|
+
// image buffers must be base64 encoded
|
|
578
|
+
if (Buffer.isBuffer(r.body) && headers["content-type"].startsWith("image/")) {
|
|
579
|
+
return {
|
|
580
|
+
statusCode: r.status,
|
|
581
|
+
headers,
|
|
582
|
+
body: r.body.toString("base64"),
|
|
583
|
+
isBase64Encoded: true
|
|
584
|
+
};
|
|
585
|
+
}`);
|
|
586
|
+
updated = true;
|
|
587
|
+
}
|
|
572
588
|
for (const wasm of Wasms) {
|
|
573
589
|
if (contents.includes(wasm.placeholder)) {
|
|
574
590
|
if (nitroCompatibility.wasm === "import") {
|