mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-19 17:59:11 -06:00
Fixes #12046: Fix URL parsing for git data sources
This commit is contained in:
parent
f965608791
commit
06dec6a2d9
@ -91,10 +91,9 @@ class GitBackend(DataBackend):
|
|||||||
username = self.params.get('username')
|
username = self.params.get('username')
|
||||||
password = self.params.get('password')
|
password = self.params.get('password')
|
||||||
if username and password:
|
if username and password:
|
||||||
url_components = list(urlparse(self.url))
|
# Add username & password to URL
|
||||||
# Prepend username & password to netloc
|
parsed = urlparse(self.url)
|
||||||
url_components[1] = quote(f'{username}@{password}:') + url_components[1]
|
url = f'{parsed.scheme}://{quote(username)}:{quote(password)}@{parsed.netloc}{parsed.path}'
|
||||||
url = urlunparse(url_components)
|
|
||||||
else:
|
else:
|
||||||
url = self.url
|
url = self.url
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user