mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 08:47:22 +00:00
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:
@@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user