fix(route): invalid url (#11597)

This commit is contained in:
Tony
2023-01-11 08:57:32 -03:00
committed by GitHub
parent 2ebefe0c40
commit e2a57e4945
4 changed files with 5 additions and 5 deletions

View File

@@ -12,7 +12,7 @@ module.exports = async (ctx) => {
starred: 'Most stars',
all: 'All',
};
if (!config.feature.allow_user_supply_unsafe_domain && !allowHost.includes(new URL(host).hostname)) {
if (!config.feature.allow_user_supply_unsafe_domain && !allowHost.includes(new URL(`https://${host}/`).hostname)) {
ctx.throw(403, `This RSS is disabled unless 'ALLOW_USER_SUPPLY_UNSAFE_DOMAIN' is set to 'true'.`);
}