Skip to content

Commit

Permalink
fix(koa): remove res.writeHead & res.send overrides (#784)
Browse files Browse the repository at this point in the history
  • Loading branch information
benjie authored Jun 22, 2018
1 parent e3bf765 commit c0c3412
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 c0c3412

Please sign in to comment.