Skip to content

Commit 644e607

Browse files
authored
Remove trailing colon when parsing the protocol from URL (#1778)
* Remove trailing colon when parsing the protocol from URL * Fix bug
1 parent 1d342cd commit 644e607

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: arduino-ide-extension/src/common/protocol/config-service.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,10 @@ export namespace Network {
6060
try {
6161
// Patter: PROTOCOL://USER:PASS@HOSTNAME:PORT/
6262
const { protocol, hostname, password, username, port } = new URL(raw);
63+
// protocol in URL object contains a trailing colon
64+
const newProtocol = protocol.replace(/:$/, '');
6365
return {
64-
protocol,
66+
protocol: newProtocol,
6567
hostname,
6668
password,
6769
username,

0 commit comments

Comments
 (0)