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