Skip to content

Commit

Permalink
fix: write on flushed header
Browse files Browse the repository at this point in the history
  • Loading branch information
loopingz committed Oct 7, 2023
1 parent 48a899a commit 2d1ef2e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core/src/utils/context.ts
Expand Up @@ -578,7 +578,7 @@ export class WebContext<T = any, U = any> extends OperationContext<T, U> {
if (this.statusCode === 204) {
this.statusCode = 200;
}
if (typeof output === "object" && !(output instanceof Buffer)) {
if (typeof output === "object" && !(output instanceof Buffer) && !this.hasFlushedHeaders()) {
this.setHeader("Content-type", "application/json");
}
return super.write(output, encoding, cb);
Expand Down

0 comments on commit 2d1ef2e

Please sign in to comment.