Skip to content

Commit

Permalink
fix: directly return stream in render handler
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Sep 21, 2023
1 parent f84c282 commit 2156efa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/runtime/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
setResponseHeader,
setResponseHeaders,
setResponseStatus,
isStream
} from "h3";
import { useNitroApp } from "./app";

Expand Down Expand Up @@ -58,7 +59,7 @@ export function defineRenderHandler(handler: RenderHandler) {
}

// Send response body
return typeof response.body === "string"
return typeof response.body === "string" || isStream(response.body)
? response.body
: JSON.stringify(response.body);
});
Expand Down

0 comments on commit 2156efa

Please sign in to comment.