webrepl icon indicating copy to clipboard operation
webrepl copied to clipboard

Use urllib to parse the URL for the host and port

Open DarioBianco opened this issue 4 years ago • 0 comments

Parse the received URL string with urllib.parse.urlparse() to extract the hostname and port number (instead of splitting the URL to extract the hostname and port).

parse_remote() previously split the host string with ":" to get the host and port number, but splitting may result in a list of 3 strings (e.g., 'ws://192.168.4.1:8266' would become ['ws', '//192.168.4.1', '8266']. The code would crash because of the double forward slashes at the beginning of the host string.

DarioBianco avatar Dec 05 '20 20:12 DarioBianco