mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-04 19:59:54 +08:00
feat(config)!: unsafe domain toggle (#11588)
This commit is contained in:
@@ -1,10 +1,16 @@
|
||||
const got = require('@/utils/got');
|
||||
const cheerio = require('cheerio');
|
||||
const { parseDate } = require('@/utils/parse-date');
|
||||
const config = require('@/config').value;
|
||||
const allowDomain = ['javdb.com', 'javdb36.com', 'javdb007.com'];
|
||||
|
||||
module.exports = {
|
||||
ProcessItems: async (ctx, currentUrl, title) => {
|
||||
const domain = ctx.query.domain ?? 'javdb.com';
|
||||
if (!config.feature.allow_user_supply_unsafe_domain && !allowDomain.includes(new URL(domain).hostname)) {
|
||||
ctx.throw(403, `This RSS is disabled unless 'ALLOW_USER_SUPPLY_UNSAFE_DOMAIN' is set to 'true'.`);
|
||||
}
|
||||
|
||||
const rootUrl = `https://${domain}`;
|
||||
|
||||
const response = await got({
|
||||
|
||||
Reference in New Issue
Block a user