0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-16 21:56:25 -05:00

chore(api): update comment about route parameters (#4719)

This commit is contained in:
Marc Bernard 2024-07-17 13:57:03 -04:00 committed by GitHub
parent 2a6ee33071
commit 19df355e3c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 2 deletions

View file

@ -0,0 +1,5 @@
---
'@verdaccio/api': patch
---
chore(api): update comment about route parameters

View file

@ -37,10 +37,11 @@ export default function (config: Config, auth: Auth, storage: Storage): Router {
app.param('revision', validateName); app.param('revision', validateName);
app.param('token', validateName); app.param('token', validateName);
// these can't be safely put into express url for some reason // Express route parameter names must be valid JavaScript identifiers, which means
// TODO: For some reason? what reason? // they cannot start with a hyphen (-) or contain special characters like dots (.)
app.param('_rev', match(/^-rev$/)); app.param('_rev', match(/^-rev$/));
app.param('org_couchdb_user', match(/^org\.couchdb\.user:/)); app.param('org_couchdb_user', match(/^org\.couchdb\.user:/));
app.use(auth.apiJWTmiddleware()); app.use(auth.apiJWTmiddleware());
app.use(express.json({ strict: false, limit: config.max_body_size || '10mb' })); app.use(express.json({ strict: false, limit: config.max_body_size || '10mb' }));
app.use(antiLoop(config)); app.use(antiLoop(config));