Updates
Rolling release / release (push) Successful in 6m40s

This commit is contained in:
2026-09-12 07:22:47 -04:00
parent e4546f8e95
commit e9040d110a
30 changed files with 1688 additions and 444 deletions
+7 -2
View File
@@ -32,7 +32,7 @@ function isBlockedHostname(hostname) {
return false;
}
function assertPublicHttpUrl(raw) {
function assertHttpUrl(raw) {
let url;
try {
url = new URL(String(raw));
@@ -42,10 +42,15 @@ function assertPublicHttpUrl(raw) {
if (url.protocol !== 'https:' && url.protocol !== 'http:') {
throw new Error('only http(s) URLs are allowed');
}
return url;
}
function assertPublicHttpUrl(raw) {
const url = assertHttpUrl(raw);
if (isBlockedHostname(url.hostname)) {
throw new Error('private, loopback, and metadata hosts are blocked');
}
return url;
}
module.exports = { isBlockedHostname, assertPublicHttpUrl };
module.exports = { isBlockedHostname, assertHttpUrl, assertPublicHttpUrl };