Browse Source

Set default `body-parser` limit to "1mb". (#25)

greenkeeper/got-9.0.0
wtgtybhertgeghgtwtg 6 years ago
committed by Luke Childs
parent
commit
9735e42ba2
  1. 8
      src/index.js

8
src/index.js

@ -24,10 +24,10 @@ const createTestServer = opts => createCert(opts && opts.certificate)
};
app.set('etag', false);
app.use(bodyParser.json(Object.assign({ type: 'application/json' }, opts && opts.bodyParser)));
app.use(bodyParser.text(Object.assign({ type: 'text/plain' }, opts && opts.bodyParser)));
app.use(bodyParser.urlencoded(Object.assign({ type: 'application/x-www-form-urlencoded', extended: true }, opts && opts.bodyParser)));
app.use(bodyParser.raw(Object.assign({ type: 'application/octet-stream' }, opts && opts.bodyParser)));
app.use(bodyParser.json(Object.assign({ limit: '1mb', type: 'application/json' }, opts && opts.bodyParser)));
app.use(bodyParser.text(Object.assign({ limit: '1mb', type: 'text/plain' }, opts && opts.bodyParser)));
app.use(bodyParser.urlencoded(Object.assign({ limit: '1mb', type: 'application/x-www-form-urlencoded', extended: true }, opts && opts.bodyParser)));
app.use(bodyParser.raw(Object.assign({ limit: '1mb', type: 'application/octet-stream' }, opts && opts.bodyParser)));
app.caCert = keys.caCert;
app.listen = () => Promise.all([

Loading…
Cancel
Save