Compare commits

..

No commits in common. "2b39f2672237326c0e7508fcdb9866064f182e2c" and "eb0c33deae8172701c61c03dc44ada131b95c5a5" have entirely different histories.

4 changed files with 0 additions and 20 deletions

BIN
db.sqlite

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,20 +0,0 @@
import { defineEventHandler, setResponseHeader } from 'h3';
export default defineEventHandler(async (event) => {
const acceptEncoding = event.headers.get('accept-encoding') || '';
if (!acceptEncoding.includes('zstd')) return;
const _end = event.node.res.end;
//@ts-expect-error
event.node.res.end = async (body: any, ...args: any[]) => {
const buffer = typeof body === "string" ? new TextEncoder().encode(body) : body;
if(buffer)
{
setResponseHeader(event, "Content-Encoding", "zstd");
setResponseHeader(event, "Vary", "Accept-Encoding");
//@ts-expect-error
_end.call(event.node.res, await Bun.zstdCompress(buffer), ...args);
}
};
});