Skip to content

Commit b4270f2

Browse files
committed
Preserve port in repo URLs when striping out auth strings
1 parent 371551d commit b4270f2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mbed/mbed.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1241,7 +1241,7 @@ def getlibs(self):
12411241

12421242
def write(self):
12431243
up = urlparse(self.url)
1244-
url = up._replace(netloc=up.hostname).geturl() # strip auth string
1244+
url = up._replace(netloc=up.hostname + (':'+str(up.port) if up.port else '')).geturl() # strip auth string
12451245

12461246
if os.path.isfile(self.lib):
12471247
with open(self.lib) as f:
@@ -1731,7 +1731,7 @@ def formaturl(url, format="default"):
17311731
else:
17321732
m = re.match(regex_repo_url, url)
17331733
if m and m.group(1) == '': # no protocol specified, probably ssh string like "[email protected]:ARMmbed/mbed-os.git"
1734-
url = 'ssh://%s%s%s/%s.git' % (m.group(2) or 'git@', m.group(6), m.group(7) or '', m.group(8)) # convert to common ssh URL-like format
1734+
url = 'ssh://%s%s%s/%s' % (m.group(2) or 'git@', m.group(6), m.group(7) or '', m.group(8)) # convert to common ssh URL-like format
17351735
m = re.match(regex_repo_url, url)
17361736

17371737
if m:

0 commit comments

Comments
 (0)