mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-19 06:38:55 +08:00
feat(config)!: unsafe domain toggle (#11588)
This commit is contained in:
@@ -1,9 +1,13 @@
|
||||
const got = require('@/utils/got');
|
||||
const cheerio = require('cheerio');
|
||||
const { isValidHost } = require('@/utils/valid-host');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const lang = ctx.params.lang || 'en';
|
||||
const id = ctx.params.id || 'bandizip';
|
||||
if (!isValidHost(lang)) {
|
||||
throw Error('Invalid language code');
|
||||
}
|
||||
|
||||
const rootUrl = `https://${lang}.bandisoft.com`;
|
||||
const currentUrl = `${rootUrl}/${id}/history/`;
|
||||
|
||||
Reference in New Issue
Block a user