diff options
author | Emanuele Aina <emanuele.aina@collabora.com> | 2021-02-25 22:53:11 +0100 |
---|---|---|
committer | Emanuele Aina <emanuele.aina@collabora.com> | 2021-03-05 01:04:00 +0100 |
commit | b4dac5ce33843cf52badeb9faf0f7f52f20a9a6a (patch) | |
tree | f3cf0de32376a1ad2381cf0bd734a68e14c37cd5 /gitlab/mixins.py | |
parent | aa132149558e797332897ec8543a9ac9fb0da09b (diff) | |
download | gitlab-b4dac5ce33843cf52badeb9faf0f7f52f20a9a6a.tar.gz |
fix: handle tags like debian/2%2.6-21 as identifiers
Git refnames are relatively free-form and can contain all sort for
special characters, not just `/` and `#`, see
http://git-scm.com/docs/git-check-ref-format
In particular, Debian's DEP-14 standard for storing packaging in git
repositories mandates the use of the `%` character in tags in some
cases like `debian/2%2.6-21`.
Unfortunately python-gitlab currently only escapes `/` to `%2F` and in
some cases `#` to `%23`. This means that when using the commit API to
retrieve information about the `debian/2%2.6-21` tag only the slash is
escaped before being inserted in the URL path and the `%` is left
untouched, resulting in something like
`/api/v4/projects/123/repository/commits/debian%2F2%2.6-21`. When
urllib3 seees that it detects the invalid `%` escape and then urlencodes
the whole string, resulting in
`/api/v4/projects/123/repository/commits/debian%252F2%252.6-21`, where
the original `/` got escaped twice and produced `%252F`.
To avoid the issue, fully urlencode identifiers and parameters to avoid
the urllib3 auto-escaping in all cases.
Signed-off-by: Emanuele Aina <emanuele.aina@collabora.com>
Diffstat (limited to 'gitlab/mixins.py')
0 files changed, 0 insertions, 0 deletions