Skip to content

Commit

Permalink
asd
Browse files Browse the repository at this point in the history
  • Loading branch information
dbarrosop committed Dec 12, 2024
1 parent 6c54316 commit abb92fa
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions examples/myproject/functions/echo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,6 @@ export default (req: Request, res: Response) => {
res.setHeader('Content-Encoding', 'gzip')
res.setHeader('Content-Type', 'application/json')

if (req.headers['accept-encoding'].includes('gzip')) {
if (req.headers['host'] === 'local.functions.local.nhost.run') {
const compressedResponse = zlib.gzipSync(JSON.stringify(response))
res.send(compressedResponse)
} else {
const compressedResponse = zlib.gzipSync(JSON.stringify(response)).toString('base64')
res.send(compressedResponse)
}
} else {
res.send(response)
}
}

0 comments on commit abb92fa

Please sign in to comment.