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.
- package/build/index.js +10 -1
- 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
|
-
|
|
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