fix(anilist): ️ improve SSE streaming

Fixes issues with SSE streaming by explicitly setting the content type and encoding headers.

Also, removes unnecessary destructuring in fetchEpisodes.
This commit is contained in:
2025-10-31 13:13:03 -04:00
parent 26037d592e
commit f6a3ea2649

View File

@@ -117,6 +117,9 @@ app.openapi(route, async (c) => {
return c.json(ErrorResponse, { status: 500 }); 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( return streamSSE(
c, c,
async (stream) => { async (stream) => {
@@ -174,7 +177,7 @@ app.openapi(route, async (c) => {
continue; continue;
} }
await fetchEpisodes(media.id, true).then(({ episodes }) => { await fetchEpisodes(media.id, true).then((episodes) => {
if (episodes.length === 0) { if (episodes.length === 0) {
return; return;
} }