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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user