From f6a3ea2649ce2a3c15553ffee5462acabbdee67c Mon Sep 17 00:00:00 2001 From: Rushil Perera Date: Fri, 31 Oct 2025 13:13:03 -0400 Subject: [PATCH] =?UTF-8?q?fix(anilist):=20=E2=9A=A1=EF=B8=8F=20improve=20?= =?UTF-8?q?SSE=20streaming?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes issues with SSE streaming by explicitly setting the content type and encoding headers. Also, removes unnecessary destructuring in fetchEpisodes. --- src/controllers/auth/anilist/index.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/controllers/auth/anilist/index.ts b/src/controllers/auth/anilist/index.ts index 602974c..6b12a6a 100644 --- a/src/controllers/auth/anilist/index.ts +++ b/src/controllers/auth/anilist/index.ts @@ -117,6 +117,9 @@ app.openapi(route, async (c) => { return c.json(ErrorResponse, { status: 500 }); } + c.header("Content-Type", "text/x-unknown"); + c.header("content-encoding", "identity"); + c.header("transfer-encoding", "chunked"); return streamSSE( c, async (stream) => { @@ -174,7 +177,7 @@ app.openapi(route, async (c) => { continue; } - await fetchEpisodes(media.id, true).then(({ episodes }) => { + await fetchEpisodes(media.id, true).then((episodes) => { if (episodes.length === 0) { return; }