Skip to content

Commit

Permalink
fix(koa): remove res.writeHead & res.send overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
benjie committed Jun 22, 2018
1 parent e3bf765 commit 7e63bcd
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -767,12 +767,7 @@ export default function createPostGraphileHttpRequestHandler(options) {

// Hack the req object so we can get back to ctx
ctx.req._koaCtx = ctx
ctx.res.writeHead = () => {
throw new Error('res.writeHead not supported in Koa environment')
}
ctx.res.send = () => {
throw new Error('res.send not supported in Koa environment')
}

const oldEnd = ctx.res.end
ctx.res.end = (body) => {
ctx.response.body = body
Expand Down

0 comments on commit 7e63bcd

Please sign in to comment.