mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-07-11 13:26: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 {
|
try {
|
||||||
// Patter: PROTOCOL://USER:PASS@HOSTNAME:PORT/
|
// Patter: PROTOCOL://USER:PASS@HOSTNAME:PORT/
|
||||||
const { protocol, hostname, password, username, port } = new URL(raw);
|
const { protocol, hostname, password, username, port } = new URL(raw);
|
||||||
|
// protocol in URL object contains a trailing colon
|
||||||
|
const newProtocol = protocol.replace(/:$/, '');
|
||||||
return {
|
return {
|
||||||
protocol,
|
protocol: newProtocol,
|
||||||
hostname,
|
hostname,
|
||||||
password,
|
password,
|
||||||
username,
|
username,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user