Minor tweaks

This commit is contained in:
Peng-YM 2021-01-25 14:23:16 +08:00
parent 20ea35c9fb
commit 85ee743988
2 changed files with 17 additions and 16 deletions

View File

@ -148,6 +148,15 @@ function service() {
const allSubs = $.read(SUBS_KEY);
const sub = allSubs[name];
if (sub) {
try {
const output = await produceArtifact({
type: 'subscription',
item: sub,
platform,
useCache,
noProcessor: raw
});
// forward flow headers
if (["QX", "Surge", "Loon"].indexOf(getPlatformFromHeaders(req.headers)) !== -1) {
const {headers} = await $.http.get({
@ -162,14 +171,6 @@ function service() {
res.set("subscription-userinfo", userinfo);
}
try {
const output = await produceArtifact({
type: 'subscription',
item: sub,
platform,
useCache,
noProcessor: raw
});
if (platform === 'JSON') {
res.set("Content-Type", "application/json;charset=utf-8").send(output);
} else {

File diff suppressed because one or more lines are too long