Allow dashes in host name in ports view

Fixes microsoft/vscode-remote-release#6148
This commit is contained in:
Alex Ross
2022-01-12 13:33:10 +01:00
parent 076a6f6235
commit d7f4200ec3

View File

@@ -120,7 +120,7 @@ export function makeAddress(host: string, port: number): string {
}
export function parseAddress(address: string): { host: string, port: number } | undefined {
const matches = address.match(/^([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+\:|localhost:|[a-zA-Z]+:)?([0-9]+)$/);
const matches = address.match(/^([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+\:|localhost:|[a-zA-Z\-]+:)?([0-9]+)$/);
if (!matches) {
return undefined;
}