Skip to content

Commit 6b3bcbe

Browse files
chfritzchris-smith
authored andcommitted
Fix regex for parsing url. (#137)
Added `_` to the valid characters in the hostname and removed ':'. Fixes #136.
1 parent 3cac727 commit 6b3bcbe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/utils/network_utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ const NetworkUtils = {
7474
},
7575

7676
getAddressAndPortFromUri(uriString) {
77-
let regexStr = /(?:http:\/\/|rosrpc:\/\/)?([a-zA-Z\d\-.:]+):(\d+)/;
77+
let regexStr = /(?:http:\/\/|rosrpc:\/\/)?([a-zA-Z\d\-_.]+):(\d+)/;
7878
let match = uriString.match(regexStr);
7979
if (match === null) {
8080
throw new Error ('Unable to find host and port from uri ' + uriString + ' with regex ' + regexStr);

0 commit comments

Comments
 (0)