1
0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-24 21:15:51 +01:00

fix: revert move bodyParse to the upper level (#1841) (#1877)

This reverts commit 67c31b69
This commit is contained in:
Juan Picado 2020-07-16 21:59:21 +02:00 committed by GitHub
parent e374a6248b
commit 844267ce25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 579 additions and 5 deletions

File diff suppressed because it is too large Load Diff

@ -3,6 +3,7 @@ import { Config } from '@verdaccio/types';
import _ from 'lodash';
import express from 'express';
import bodyParser from 'body-parser';
import whoami from './api/whoami';
import ping from './api/ping';
import user from './api/user';
@ -41,6 +42,7 @@ export default function(config: Config, auth: IAuth, storage: IStorageHandler) {
app.param('anything', match(/.*/));
app.use(auth.apiJWTmiddleware());
app.use(bodyParser.json({ strict: false, limit: config.max_body_size || '10mb' }));
app.use(antiLoop(config));
// encode / in a scoped package name to be matched as a single parameter in routes
app.use(encodeScopePackage);

@ -1,6 +1,5 @@
import _ from 'lodash';
import express, { Application } from 'express';
import bodyParser from 'body-parser';
import compression from 'compression';
import cors from 'cors';
import { HttpError } from 'http-errors';
@ -47,8 +46,6 @@ const defineAPI = function(config: IConfig, storage: IStorageHandler): any {
hookDebug(app, config.self_path);
}
app.use(bodyParser.json({ strict: false, limit: config.max_body_size || '10mb' }));
// register middleware plugins
const plugin_params = {
config: config,