feat(config)!: unsafe domain toggle (#11588)

This commit is contained in:
Tony
2023-01-10 11:45:05 +00:00
committed by GitHub
parent ab2f61824d
commit a66cbcf6ee
66 changed files with 338 additions and 15 deletions

View File

@@ -4,9 +4,13 @@ const md = require('markdown-it')({
html: true,
});
const dayjs = require('dayjs');
const { isValidHost } = require('@/utils/valid-host');
module.exports = async (ctx) => {
const type = ctx.params.type;
if (!isValidHost(type)) {
throw Error('Invalid type');
}
const url = `https://${type}.hedwig.pub`;
const res = await got({