mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
fix: Do not add port 80 to default base URL
This commit is contained in:
parent
c332412074
commit
bb7427842c
@ -22,6 +22,8 @@ export class BaseUrlExtractor extends ShorthandExtractor {
|
||||
throw new Error('BaseUrl argument should be provided when using Unix Domain Sockets.');
|
||||
}
|
||||
const port = args.port ?? this.defaultPort;
|
||||
return `http://localhost:${port}/`;
|
||||
const url = new URL('http://localhost/');
|
||||
url.port = `${port}`;
|
||||
return url.href;
|
||||
}
|
||||
}
|
||||
|
@ -24,4 +24,8 @@ describe('A BaseUrlExtractor', (): void => {
|
||||
it('defaults to port 3000.', async(): Promise<void> => {
|
||||
await expect(computer.handle({})).resolves.toBe('http://localhost:3000/');
|
||||
});
|
||||
|
||||
it('does not add the port if it is 80.', async(): Promise<void> => {
|
||||
await expect(computer.handle({ port: 80 })).resolves.toBe('http://localhost/');
|
||||
});
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user