Skip to content

Commit

Permalink
proxy /
Browse files Browse the repository at this point in the history
  • Loading branch information
Henri Wahl committed Oct 30, 2023
1 parent c13aaeb commit 266b58e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Nagstamon/Servers/Generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ def proxify(self, requester):
if self.proxy_username == self.proxy_password == '':
user_pass = ''
else:
user_pass = '{0}:{1}@'.format(self.proxy_username, self.proxy_password)
user_pass = '{0}:{1}'.format(self.proxy_username, self.proxy_password)

# split and analyze proxy URL
proxy_address_parts = self.proxy_address.split('//')
Expand All @@ -370,7 +370,7 @@ def proxify(self, requester):
# use only valid schemes
if scheme.lower() in ('http:', 'https:', 'socks5:', 'socks5h:'):
# merge proxy URL
proxy_url = '{0}//{1}{2}'.format(scheme, user_pass, host_port)
proxy_url = f'{scheme}//{user_pass}@{host_port}/'
# fill session.proxies for both protocols
requester.proxies = {'http': proxy_url, 'https': proxy_url}
else:
Expand Down

0 comments on commit 266b58e

Please sign in to comment.