mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
chore(fetch): host does not include port (#21845)
This commit is contained in:
parent
1bbe2b4b6a
commit
1004e762aa
@ -130,7 +130,7 @@ function clientRequestArgsToHostName(options: http.ClientRequestArgs): string {
|
||||
if (options.hostname)
|
||||
return options.hostname;
|
||||
if (options.host)
|
||||
return options.host.split(':')[0];
|
||||
return options.host;
|
||||
throw new Error('Either options.hostname or options.host must be provided');
|
||||
}
|
||||
|
||||
|
||||
@ -60,3 +60,9 @@ it('https post should work with ignoreHTTPSErrors option', async ({ context, htt
|
||||
expect(interceptedHostnameLookup).toBe('localhost');
|
||||
});
|
||||
|
||||
|
||||
it('should work with ip6 and port as the host', async ({ request, server }) => {
|
||||
const response = await request.get(`http://[::1]:${server.PORT}/simple.json`);
|
||||
expect(response.url()).toBe(`http://[::1]:${server.PORT}/simple.json`);
|
||||
expect(response).toBeOK();
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user