0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2025-02-17 23:45:29 -05:00

refactor: rename anti_loop function to antiLoop (#1057)

This commit is contained in:
Ashish Surana 2018-10-07 04:02:17 +05:30 committed by Juan Picado @jotadeveloper
parent 5673436a78
commit 71e34e2194
2 changed files with 3 additions and 3 deletions

View file

@ -16,7 +16,7 @@ import publish from './api/publish';
import search from './api/search';
import pkg from './api/package';
const { match, validateName, validatePackage, encodeScopePackage, anti_loop } = require('../middleware');
const { match, validateName, validatePackage, encodeScopePackage, antiLoop } = require('../middleware');
export default function(config: Config, auth: IAuth, storage: IStorageHandler) {
/* eslint new-cap:off */
@ -42,7 +42,7 @@ export default function(config: Config, auth: IAuth, storage: IStorageHandler) {
app.use(auth.apiJWTmiddleware());
app.use(bodyParser.json({ strict: false, limit: config.max_body_size || '10mb' }));
app.use(anti_loop(config));
app.use(antiLoop(config));
// encode / in a scoped package name to be matched as a single parameter in routes
app.use(encodeScopePackage);
// for "npm whoami"

View file

@ -79,7 +79,7 @@ export function expectJson(req: $RequestExtend, res: $ResponseExtend, next: $Nex
next();
}
export function anti_loop(config: Config) {
export function antiLoop(config: Config) {
return function(req: $RequestExtend, res: $ResponseExtend, next: $NextFunctionVer) {
if (req.headers.via != null) {
let arr = req.headers.via.split(',');