mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 23:46:14 -04:00
build(deps): bump formidable from 2.1.2 to 3.5.0 in /src (#5796)
* build(deps): bump formidable from 2.1.2 to 3.5.0 in /src Bumps [formidable](https://github.com/node-formidable/formidable) from 2.1.2 to 3.5.0. - [Release notes](https://github.com/node-formidable/formidable/releases) - [Changelog](https://github.com/node-formidable/formidable/blob/master/CHANGELOG.md) - [Commits](https://github.com/node-formidable/formidable/commits/v3.5.0) --- updated-dependencies: - dependency-name: formidable dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * formidable migration --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: John McLear <john@mclear.co.uk>
This commit is contained in:
parent
24720abdc8
commit
4da66d19dc
5 changed files with 64 additions and 38 deletions
|
@ -15,8 +15,7 @@
|
|||
*/
|
||||
|
||||
const OpenAPIBackend = require('openapi-backend').default;
|
||||
const formidable = require('formidable');
|
||||
const {promisify} = require('util');
|
||||
const IncomingForm = require('formidable').IncomingForm;
|
||||
const cloneDeep = require('lodash.clonedeep');
|
||||
const createHTTPError = require('http-errors');
|
||||
|
||||
|
@ -596,9 +595,13 @@ exports.expressPreSession = async (hookName, {app}) => {
|
|||
// read form data if method was POST
|
||||
let formData = {};
|
||||
if (c.request.method === 'post') {
|
||||
const form = new formidable.IncomingForm();
|
||||
const parseForm = promisify(form.parse).bind(form);
|
||||
formData = await parseForm(req);
|
||||
const form = new IncomingForm();
|
||||
formData = (await form.parse(req))[0];
|
||||
for (const k of Object.keys(formData)) {
|
||||
if (formData[k] instanceof Array) {
|
||||
formData[k] = formData[k][0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const fields = Object.assign({}, header, params, query, formData);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue