Compare commits

..

1 Commits

Author SHA1 Message Date
xream
ecb2302978 feat: url 支持 credentials; 修改导出文件名格式 2025-03-13 17:37:40 +08:00
3 changed files with 12 additions and 12 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "sub-store",
"version": "2.18.2",
"version": "2.18.1",
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.",
"main": "src/main.js",
"scripts": {

View File

@@ -23,11 +23,7 @@ export default function URI_Producer() {
) {
delete proxy.tls;
}
if (
!['vmess'].includes(proxy.type) &&
proxy.server &&
isIPv6(proxy.server)
) {
if (proxy.server && isIPv6(proxy.server)) {
proxy.server = `[${proxy.server}]`;
}
switch (proxy.type) {

View File

@@ -374,14 +374,18 @@ export function HTTP(defaultOptions = { baseURL: '' }) {
};
try {
const url = new URL(opts.url);
if (url.username || url.password) {
const auth =
url.username || url.password
? Buffer.from(
`${url.username || ''}:${
url.password || ''
}`,
).toString('base64')
: undefined;
if (auth) {
opts.headers = {
...(opts.headers || {}),
Authorization: `Basic ${Buffer.from(
`${url.username || ''}:${
url.password || ''
}`,
).toString('base64')}`,
Authorization: `Basic ${auth}`,
};
}
const response = await request(opts.url, {