diff --git a/backend/package.json b/backend/package.json index 1ae4537..7b9b0da 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "sub-store", - "version": "2.14.382", + "version": "2.14.383", "description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.", "main": "src/main.js", "scripts": { diff --git a/backend/src/core/proxy-utils/index.js b/backend/src/core/proxy-utils/index.js index 57e0f88..1e2f04e 100644 --- a/backend/src/core/proxy-utils/index.js +++ b/backend/src/core/proxy-utils/index.js @@ -9,6 +9,7 @@ import { isNotBlank, ipAddress, getRandomPort, + numberToString, } from '@/utils'; import PROXY_PROCESSORS, { ApplyProcessor } from './processors'; import PROXY_PREPROCESSORS from './preprocessors'; @@ -327,6 +328,9 @@ function formatTransportPath(path) { } function lastParse(proxy) { + if (typeof proxy.password === 'number') { + proxy.password = numberToString(proxy.password); + } if (proxy.interface) { proxy['interface-name'] = proxy.interface; delete proxy.interface; diff --git a/backend/src/utils/index.js b/backend/src/utils/index.js index 9b74698..8330bea 100644 --- a/backend/src/utils/index.js +++ b/backend/src/utils/index.js @@ -111,6 +111,12 @@ function getRandomPort(portString) { } } +function numberToString(value) { + return Number.isSafeInteger(value) + ? String(value) + : BigInt(value).toString(); +} + export { ipAddress, isIPv4, @@ -123,4 +129,5 @@ export { // utf8ArrayToStr, getPolicyDescriptor, getRandomPort, + numberToString, };