Skip to content

Commit

Permalink
fix: allow underscore as a valid char in tunnel remote address (#190904)
Browse files Browse the repository at this point in the history
adjust the regexes used to validate tunnel remote addresses, add underscore as a valid char.
  • Loading branch information
floge07 authored Aug 21, 2023
1 parent 548c32e commit d0b14e8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
{
"type": "string",
"pattern": "^([a-z0-9-]+):(\\d{1,5})$"
"pattern": "^([a-z0-9_-]+):(\\d{1,5})$"
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion src/vs/workbench/services/remote/common/tunnelModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export interface Tunnel {
}

export function parseAddress(address: string): { host: string; port: number } | undefined {
const matches = address.match(/^([a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*:)?([0-9]+)$/);
const matches = address.match(/^([a-zA-Z0-9_-]+(?:\.[a-zA-Z0-9_-]+)*:)?([0-9]+)$/);
if (!matches) {
return undefined;
}
Expand Down

0 comments on commit d0b14e8

Please sign in to comment.