Merge pull request #158 from AikidoSec/prevent-packagemanager-from-caching-modified-response

Prevent package manager from caching modified response
This commit is contained in:
Sander Declerck 2025-11-24 18:37:44 +01:00 committed by GitHub
commit fb3a8582a2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -87,6 +87,9 @@ export function modifyNpmInfoResponse(body, headers) {
// no longer match the content so they needs to be removed before sending the response. // no longer match the content so they needs to be removed before sending the response.
delete headers["etag"]; delete headers["etag"];
delete headers["last-modified"]; delete headers["last-modified"];
// Removing the cache-control header will prevent the package manager from caching
// the modified response.
delete headers["cache-control"];
} }
} }
} }