| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
|
||
| def clean_str_id(id: str) -> str: | ||
| return id.replace("/", "%2F").replace("#", "%23") | ||
| def clean_str_id(id): |
There was a problem hiding this comment.
Can the type-hints not be removed?
Sorry, something went wrong.
There was a problem hiding this comment.
Uuuuh, absolutely yes, sorry. Fixing it now!
Sorry, something went wrong.
|
Overall looks good to me. Please put the type-hints back in. Also change "fix: Handle..." to "fix: handle" to fix the lint issue. Thanks. |
Sorry, something went wrong.
Codecov Report
@@ Coverage Diff @@
## master #1336 +/- ##
=======================================
Coverage 80.21% 80.21%
=======================================
Files 73 73
Lines 3801 3801
=======================================
Hits 3049 3049
Misses 752 752
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Sorry, something went wrong.
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>
| Back | FazBrowse Home | New Git URL |
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 sees 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.
I've run the unit tests but not the integration ones, so in theory this does
not break anything but I can't really confirm it. All I can firmly say is that it
fixes the issue I hit. :D