diff options
author | Max Wittig <max.wittig@siemens.com> | 2020-08-26 11:01:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-26 11:01:17 +0200 |
commit | a7e44a0bb3629f776a52967d56ba67d9a61346eb (patch) | |
tree | 24fb533a60a84e71386cc500d6ac2f00548f96ac /gitlab/utils.py | |
parent | e2dc9ece1a0af37073c41bfa8161fcec5fa01234 (diff) | |
parent | 204782a117f77f367dee87aa2c70822587829147 (diff) | |
download | gitlab-a7e44a0bb3629f776a52967d56ba67d9a61346eb.tar.gz |
Merge pull request #1078 from python-gitlab/refactor/split-unit-tests
Refactor: split unit tests by API resources
Diffstat (limited to 'gitlab/utils.py')
-rw-r--r-- | gitlab/utils.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gitlab/utils.py b/gitlab/utils.py index 4241787..67cb7f4 100644 --- a/gitlab/utils.py +++ b/gitlab/utils.py @@ -51,6 +51,14 @@ def clean_str_id(id): return id.replace("/", "%2F").replace("#", "%23") +def sanitize_parameters(value): + if isinstance(value, dict): + return dict((k, sanitize_parameters(v)) for k, v in value.items()) + if isinstance(value, str): + return value.replace("/", "%2F") + return value + + def sanitized_url(url): parsed = urlparse(url) new_path = parsed.path.replace(".", "%2E") |