feat(rest): strip trailing slash from proxy baseUrl if present in createRestManager() (#5101)

* support docker swarm urls

* Update packages/rest/tests/unit/manager.spec.ts

Co-authored-by: Awesome Stickz <38146668+AwesomeStickz@users.noreply.github.com>

* Update packages/rest/tests/unit/manager.spec.ts

Co-authored-by: Awesome Stickz <38146668+AwesomeStickz@users.noreply.github.com>

* Apply suggestion from @AwesomeStickz

* remove property

* Update packages/rest/src/types.ts

---------

Co-authored-by: Awesome Stickz <38146668+AwesomeStickz@users.noreply.github.com>
This commit is contained in:
Noah
2026-06-24 16:10:42 +05:30
committed by GitHub
co-authored by Awesome Stickz
parent 678a76fd9c
commit b878b3cb43
3 changed files with 9 additions and 4 deletions
+8 -2
View File
@@ -38,9 +38,15 @@ describe('[rest] manager', () => {
expect(rest.baseUrl).to.be.equal(options.proxy.baseUrl);
});
it('Strips a trailing slash from proxy base urls', () => {
const rest = createRestManager({ ...options, proxy: { ...options.proxy, baseUrl: 'https://localhost:8000/' } });
expect(rest.baseUrl).to.be.equal('https://localhost:8000');
expect(rest.isProxied).to.be.equal(true);
});
it('With an application id', () => {
const subrest = createRestManager({ ...options, applicationId: '130136895395987456' });
expect(subrest.applicationId).to.be.equal(130136895395987456n);
const rest = createRestManager({ ...options, applicationId: '130136895395987456' });
expect(rest.applicationId).to.be.equal(130136895395987456n);
});
});