diff options
author | Nejc Habjan <hab.nejc@gmail.com> | 2021-03-07 00:32:16 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-07 00:32:16 +0100 |
commit | 48fc907403b630f069dfd63fada73f96a8c6e983 (patch) | |
tree | 641ae29352584e9a6be7479af8202d442f3d63f9 /gitlab/utils.py | |
parent | 63ecd2eba82408b034a90026050748c855a3ac96 (diff) | |
parent | b4dac5ce33843cf52badeb9faf0f7f52f20a9a6a (diff) | |
download | gitlab-48fc907403b630f069dfd63fada73f96a8c6e983.tar.gz |
Merge pull request #1336 from em-/fix/quote-everything
fix: handle tags like debian/2%2.6-21 as identifiers
Diffstat (limited to 'gitlab/utils.py')
-rw-r--r-- | gitlab/utils.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gitlab/utils.py b/gitlab/utils.py index 987f1d3..45a4af8 100644 --- a/gitlab/utils.py +++ b/gitlab/utils.py @@ -16,7 +16,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. from typing import Any, Callable, Dict, Optional -from urllib.parse import urlparse +from urllib.parse import quote, urlparse import requests @@ -57,14 +57,14 @@ def copy_dict(dest: Dict[str, Any], src: Dict[str, Any]) -> None: def clean_str_id(id: str) -> str: - return id.replace("/", "%2F").replace("#", "%23") + return quote(id, safe="") 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 quote(value, safe="") return value |