summaryrefslogtreecommitdiff
path: root/gitlab/utils.py
diff options
context:
space:
mode:
authorGauvain Pocentek <gauvain@pocentek.net>2019-06-08 10:04:27 +0200
committerGauvain Pocentek <gauvain@pocentek.net>2019-06-08 10:04:27 +0200
commit14f538501bfb47c92e02e615d0817675158db3cf (patch)
tree8631c021a03e6c5d7f61f78e7ff10ab4340ab946 /gitlab/utils.py
parent794d64c8ef8ef0448205b51ff4a25c1589c2b2dd (diff)
downloadgitlab-14f538501bfb47c92e02e615d0817675158db3cf.tar.gz
fix: convert # to %23 in URLsfix/779
Refactor a bit to handle this change, and add unit tests. Closes #779
Diffstat (limited to 'gitlab/utils.py')
-rw-r--r--gitlab/utils.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/gitlab/utils.py b/gitlab/utils.py
index 6b43800..94528e1 100644
--- a/gitlab/utils.py
+++ b/gitlab/utils.py
@@ -47,6 +47,10 @@ def copy_dict(dest, src):
dest[k] = v
+def clean_str_id(id):
+ return id.replace("/", "%2F").replace("#", "%23")
+
+
def sanitized_url(url):
parsed = six.moves.urllib.parse.urlparse(url)
new_path = parsed.path.replace(".", "%2E")