Skip to content

Commit

Permalink
fix(koa): disable koa-compress when using send (#789)
Browse files Browse the repository at this point in the history
`send` and `koa-compress` conflict, so bypass `koa-compress` when using `send`
  • Loading branch information
benjie committed Jun 30, 2018
1 parent 797e573 commit bb851da
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/postgraphile/http/createPostGraphileHttpRequestHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,9 @@ export default function createPostGraphileHttpRequestHandler(options) {

// Sends the asset at this path. Defaults to a `statusCode` of 200.
res.statusCode = 200
if (req._koaCtx) {
req._koaCtx.compress = false
}
await new Promise((resolve, reject) => {
const stream = sendFile(req, assetPathRelative, {
index: false,
Expand Down

0 comments on commit bb851da

Please sign in to comment.