mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
Add skipMinimumPackageAge.
This commit is contained in:
parent
a9a4d76705
commit
f64ee3bccf
3 changed files with 51 additions and 3 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import { skipMinimumPackageAge } from "../../../config/settings.js";
|
||||
import { isMalwarePackage } from "../../../scanning/audit/index.js";
|
||||
import { interceptRequests } from "../interceptorBuilder.js";
|
||||
import {
|
||||
|
|
@ -38,7 +39,7 @@ function buildNpmInterceptor(registry) {
|
|||
reqContext.blockMalware(packageName, version);
|
||||
}
|
||||
|
||||
if (isPackageInfoUrl(reqContext.targetUrl)) {
|
||||
if (!skipMinimumPackageAge() && isPackageInfoUrl(reqContext.targetUrl)) {
|
||||
reqContext.modifyRequestHeaders(modifyNpmInfoRequestHeaders);
|
||||
reqContext.modifyBody(modifyNpmInfoResponse);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue