mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-08-10 22:19:00 +08:00
Minor tweaks
This commit is contained in:
parent
20ea35c9fb
commit
85ee743988
@ -148,20 +148,6 @@ function service() {
|
|||||||
const allSubs = $.read(SUBS_KEY);
|
const allSubs = $.read(SUBS_KEY);
|
||||||
const sub = allSubs[name];
|
const sub = allSubs[name];
|
||||||
if (sub) {
|
if (sub) {
|
||||||
// forward flow headers
|
|
||||||
if (["QX", "Surge", "Loon"].indexOf(getPlatformFromHeaders(req.headers)) !== -1) {
|
|
||||||
const {headers} = await $.http.get({
|
|
||||||
url: sub.url,
|
|
||||||
headers: {
|
|
||||||
"User-Agent":
|
|
||||||
"Quantumult/1.0.13 (iPhone10,3; iOS 14.0)"
|
|
||||||
}
|
|
||||||
});
|
|
||||||
const subkey = Object.keys(headers).filter(k => /SUBSCRIPTION-USERINFO/i.test(k))[0];
|
|
||||||
const userinfo = headers[subkey];
|
|
||||||
res.set("subscription-userinfo", userinfo);
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const output = await produceArtifact({
|
const output = await produceArtifact({
|
||||||
type: 'subscription',
|
type: 'subscription',
|
||||||
@ -170,6 +156,21 @@ function service() {
|
|||||||
useCache,
|
useCache,
|
||||||
noProcessor: raw
|
noProcessor: raw
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// forward flow headers
|
||||||
|
if (["QX", "Surge", "Loon"].indexOf(getPlatformFromHeaders(req.headers)) !== -1) {
|
||||||
|
const {headers} = await $.http.get({
|
||||||
|
url: sub.url,
|
||||||
|
headers: {
|
||||||
|
"User-Agent":
|
||||||
|
"Quantumult/1.0.13 (iPhone10,3; iOS 14.0)"
|
||||||
|
}
|
||||||
|
});
|
||||||
|
const subkey = Object.keys(headers).filter(k => /SUBSCRIPTION-USERINFO/i.test(k))[0];
|
||||||
|
const userinfo = headers[subkey];
|
||||||
|
res.set("subscription-userinfo", userinfo);
|
||||||
|
}
|
||||||
|
|
||||||
if (platform === 'JSON') {
|
if (platform === 'JSON') {
|
||||||
res.set("Content-Type", "application/json;charset=utf-8").send(output);
|
res.set("Content-Type", "application/json;charset=utf-8").send(output);
|
||||||
} else {
|
} else {
|
||||||
|
4
backend/sub-store.min.js
vendored
4
backend/sub-store.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user