From 3eac6f9901c7dac337a348b6cc4e3eccf0c4ccc3 Mon Sep 17 00:00:00 2001 From: Makito Date: Wed, 30 Jul 2025 00:44:15 +0900 Subject: [PATCH] fix(docs): call writeHead before write and remove next() (#332) --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- docs/.vitepress/plugins/vite-frontmatter-assets.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/.vitepress/plugins/vite-frontmatter-assets.ts b/docs/.vitepress/plugins/vite-frontmatter-assets.ts index bb68f3e0b..a2ec81203 100644 --- a/docs/.vitepress/plugins/vite-frontmatter-assets.ts +++ b/docs/.vitepress/plugins/vite-frontmatter-assets.ts @@ -155,15 +155,13 @@ export function frontmatterAssets(): Plugin { const ext = parse(filePath).ext.slice(1) const fileContent = await readFile(filePath) - res.write(fileContent) res.writeHead(200, { 'Content-Type': ext === 'svg' ? 'image/svg+xml' : `image/${ext}`, 'Content-Length': fileContent.length, 'Cache-Control': 'public, max-age=31536000, immutable', }) + res.end(fileContent) res.end() - - return next() }) }, async writeBundle() {