tencentcloud-edgeone-migration-nodejs-v2
Version:
tencentcloud cdn config copy to edgeone
44 lines (40 loc) • 1.08 kB
JavaScript
const { t } = require("../../i18n/trans");
const genLog = require("../../logGenerator");
function FollowRedirect(domain, domainConfig, ruleTransferLog) {
const keyConfig = domainConfig.FollowRedirect;
if (!keyConfig || keyConfig.Switch !== 'on') {
ruleTransferLog.push({
config: t('回源跟随301/302配置(FollowRedirect)'),
result: t('未配置'),
detail: ''
});
genLog.defaultLog(`${t('回源跟随301/302配置(FollowRedirect)')}${t('未配置')}`)
return null;
}
ruleTransferLog.push({
config: t('回源跟随301/302配置(FollowRedirect)'),
result: t('成功'),
detail: ''
});
genLog.successLog(`${t('回源跟随301/302配置(FollowRedirect)')}${t('成功')}`)
return {
'NormalAction': {
'Action': 'UpstreamFollowRedirect',
'Parameters': [
{
'Name': 'Switch',
'Values': [
'on'
]
},
{
'Name': 'MaxTimes',
'Values': [
'3'
]
}
]
}
};
}
module.exports = FollowRedirect;