Skip to content

Commit

Permalink
fix: URL encode proxy credentials (#213)
Browse files Browse the repository at this point in the history
* URL encode proxy credentials

* style: pre-commit

---------

Co-authored-by: Glauche, Daniel <daniel.glauche@sva.de>
Co-authored-by: Artem Rys <rysartem@gmail.com>
  • Loading branch information
3 people authored May 17, 2023
1 parent 139eb6b commit f28f8e1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions splunktaucclib/modinput_wrapper/base_modinput.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import os
import sys
import tempfile
import urllib

from solnlib import utils as sutils
from solnlib.log import Logs
Expand Down Expand Up @@ -513,6 +514,13 @@ def _get_proxy_uri(self):
if proxy.get("proxy_port"):
uri = "{}:{}".format(uri, proxy.get("proxy_port"))
if proxy.get("proxy_username") and proxy.get("proxy_password"):
proxy["proxy_username"] = urllib.parse.quote_plus(
proxy["proxy_username"]
)
proxy["proxy_password"] = urllib.parse.quote_plus(
proxy["proxy_password"]
)

uri = "{}://{}:{}@{}/".format(
proxy["proxy_type"],
proxy["proxy_username"],
Expand Down

0 comments on commit f28f8e1

Please sign in to comment.