verdaccio-security-filter 1.3.5 → 1.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/build/index.js +10 -1
  2. package/package.json +1 -1
package/build/index.js CHANGED
@@ -193,7 +193,16 @@ class SecurityFilterPlugin {
193
193
  this.logger.info(`[Middleware] Config mode: ${this.config.mode || 'NOT SET'}`);
194
194
  app.use((req, res, next) => __awaiter(this, void 0, void 0, function* () {
195
195
  try {
196
- const urlMatch = req.url.match(/^\/(@[^/]+\/)?([^/]+)(?:\/-\/([^/]+\.tgz))?/);
196
+ if ((req.method !== 'GET' && req.method !== 'HEAD') || req.url.startsWith('/-/')) {
197
+ return next();
198
+ }
199
+ let path = req.url.split('?')[0];
200
+ try {
201
+ path = decodeURIComponent(path);
202
+ }
203
+ catch (_a) {
204
+ }
205
+ const urlMatch = path.match(/^\/(@[^/]+\/)?([^/]+)(?:\/-\/([^/]+\.tgz))?/);
197
206
  if (!urlMatch) {
198
207
  this.logger.debug(`[Middleware] Non-package request: ${req.method} ${req.url}`);
199
208
  return next();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "verdaccio-security-filter",
3
- "version": "1.3.5",
3
+ "version": "1.3.7",
4
4
  "description": "Advanced security filter plugin for Verdaccio with version range blocking and fallback strategies",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",