diff --git a/backend/src/core/proxy-utils/parsers/index.js b/backend/src/core/proxy-utils/parsers/index.js index e4461814..0be4f9c5 100644 --- a/backend/src/core/proxy-utils/parsers/index.js +++ b/backend/src/core/proxy-utils/parsers/index.js @@ -2130,7 +2130,6 @@ function URI_AnyTLS() { // eslint-disable-next-line no-unused-vars let [__, password, server, port, addons = '', name] = /^(.*?)@(.*?)(?::(\d+))?\/?(?:\?(.*?))?(?:#(.*?))?$/.exec(line); - password = decodeURIComponent(password); port = parseInt(`${port}`, 10); if (isNaN(port)) { port = 443; diff --git a/backend/src/test/proxy-producers/text.spec.js b/backend/src/test/proxy-producers/text.spec.js index e5bfe41b..1d08ecf5 100644 --- a/backend/src/test/proxy-producers/text.spec.js +++ b/backend/src/test/proxy-producers/text.spec.js @@ -5817,6 +5817,23 @@ describe('Proxy text producers', function () { expect(parsed.password).to.equal('p@ss:w/rd#1?'); }); + for (const password of ['p%40ss', 'p%ss']) { + it(`round-trips the URI AnyTLS password ${password}`, function () { + const output = produceExternal('URI', { + type: 'anytls', + name: 'URI AnyTLS Password', + server: 'anytls.example.com', + port: 443, + password, + sni: 'anytls.example.com', + }); + + const parsed = ProxyUtils.parse(output); + expect(parsed).to.have.length(1); + expect(parsed[0].password).to.equal(password); + }); + } + it('produces URI Trojan links with vcn from the sidecar', function () { const output = produceExternal('URI', { type: 'trojan',