From c3cdd4b5688d8fb3e6f5024b7e4e7dfb36fe7e30 Mon Sep 17 00:00:00 2001 From: lyz05 <294068487@qq.com> Date: Mon, 2 Jan 2023 19:13:47 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dsubconverter=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E4=B8=8D=E5=88=B0node=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- routes/airportsub.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/routes/airportsub.js b/routes/airportsub.js index 25853ff..f451147 100644 --- a/routes/airportsub.js +++ b/routes/airportsub.js @@ -57,8 +57,14 @@ router.get("/", async function (req, res) { const subinfo = database.suburl[req.query.ctype]; //返回指定订阅信息 if (subinfo) { - const url = await oss.signurl("SUB/" + req.query.ctype, true); - res.redirect(url); + // 判断是否要生成加速链接,是否为订阅转换 + if (!req.headers['subconverter-request']) { + const url = await oss.signurl("SUB/" + req.query.ctype, true); + res.redirect(url); + } else { + const ret = await oss.get("SUB/" + req.query.ctype); + res.type("text/plain").end(ret); + } } else { res.status(404).send("Not Found 找不到这种订阅类型"); }