mirror of
https://github.com/sub-store-org/Sub-Store.git
synced 2025-08-10 00:52:40 +00:00
refactor: Download API
Now the download APIs are moved into a new file
This commit is contained in:
15
backend/src/utils/flow.js
Normal file
15
backend/src/utils/flow.js
Normal file
@@ -0,0 +1,15 @@
|
||||
import { HTTP } from '@/vendor/open-api';
|
||||
|
||||
export async function getFlowHeaders(url) {
|
||||
const http = HTTP();
|
||||
const { headers } = await http.get({
|
||||
url,
|
||||
headers: {
|
||||
'User-Agent': 'Quantumult%20X/1.0.30 (iPhone14,2; iOS 15.6)',
|
||||
},
|
||||
});
|
||||
const subkey = Object.keys(headers).filter((k) =>
|
||||
/SUBSCRIPTION-USERINFO/i.test(k),
|
||||
)[0];
|
||||
return headers[subkey];
|
||||
}
|
||||
Reference in New Issue
Block a user