forwardemail / forwardemail/supertest
send request with gzipped body
- Dominant language
- JavaScript
- Stars
- 14.4k
- Forks
- 782
- PR merge metrics
- No merged PRs in 30d
Description
I am trying to send a request with the gzipped body with supertest. But body-parser middleware return 400. json is valid json array. endpoint works fine when i send request with postman or curl.
test.js
```
const gzippedBody = zlib.gzipSync(JSON.stringify(json)).toString();
const response = await request(app)
.post('/signals')
.set('api_key', createAccessToken(appID, deviceID))
.set('Content-Type', 'application/json')
.set('Content-Encoding', 'gzip')
.send(gzippedBody);
```
app.js
```
const app = express();
app.use(
bodyParser.json({
limit: '50mb'
})
);
app.use(
bodyParser.urlencoded({
extended: true
})
);
app.use('/signals', signalsRouter);
```
Contributor guide
Assessment
This issue has not been assessed yet.