mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-07-09 20:36:32 +00:00
Remove trailing colon when parsing the protocol from URL (#1778)
* Remove trailing colon when parsing the protocol from URL * Fix bug
This commit is contained in:
parent
1d342cdbd0
commit
644e6079b3
@ -60,8 +60,10 @@ export namespace Network {
|
||||
try {
|
||||
// Patter: PROTOCOL://USER:PASS@HOSTNAME:PORT/
|
||||
const { protocol, hostname, password, username, port } = new URL(raw);
|
||||
// protocol in URL object contains a trailing colon
|
||||
const newProtocol = protocol.replace(/:$/, '');
|
||||
return {
|
||||
protocol,
|
||||
protocol: newProtocol,
|
||||
hostname,
|
||||
password,
|
||||
username,
|
||||
|
Loading…
x
Reference in New Issue
Block a user