diff options
author | John L. Villalovos <john@sodarock.com> | 2021-12-20 14:24:17 -0800 |
---|---|---|
committer | John L. Villalovos <john@sodarock.com> | 2021-12-20 14:24:17 -0800 |
commit | 702e41dd0674e76b292d9ea4f559c86f0a99edfe (patch) | |
tree | 7af846efbabb09e7941d599503ae658f37dea6f7 /tests/unit/objects/test_releases.py | |
parent | ccefe80f150eb50176e52b8c9f5b4d0bdb4f5b43 (diff) | |
download | gitlab-jlvillal/leave_dot.tar.gz |
fix: stop encoding '.' to '%2E'jlvillal/leave_dot
Forcing the encoding of '.' to '%2E' causes issues. It also goes
against the RFC:
https://datatracker.ietf.org/doc/html/rfc3986.html#section-2.3
From the RFC:
For consistency, percent-encoded octets in the ranges of ALPHA
(%41-%5A and %61-%7A), DIGIT (%30-%39), hyphen (%2D), period (%2E),
underscore (%5F), or tilde (%7E) should not be created by URI
producers...
Closes #1006
Related #1356
Related #1561
BREAKING CHANGE: stop encoding '.' to '%2E'. This could potentially be
a breaking change for users who have incorrectly configured GitLab
servers which don't handle period '.' characters correctly.
Diffstat (limited to 'tests/unit/objects/test_releases.py')
-rw-r--r-- | tests/unit/objects/test_releases.py | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/tests/unit/objects/test_releases.py b/tests/unit/objects/test_releases.py index 58ab5d0..3a4cee5 100644 --- a/tests/unit/objects/test_releases.py +++ b/tests/unit/objects/test_releases.py @@ -11,13 +11,12 @@ import responses from gitlab.v4.objects import ProjectReleaseLink tag_name = "v1.0.0" -encoded_tag_name = "v1%2E0%2E0" release_name = "demo-release" release_description = "my-rel-desc" released_at = "2019-03-15T08:00:00Z" link_name = "hello-world" link_url = "https://gitlab.example.com/group/hello/-/jobs/688/artifacts/raw/bin/hello-darwin-amd64" -direct_url = f"https://gitlab.example.com/group/hello/-/releases/{encoded_tag_name}/downloads/hello-world" +direct_url = f"https://gitlab.example.com/group/hello/-/releases/{tag_name}/downloads/hello-world" new_link_type = "package" link_content = { "id": 2, @@ -37,14 +36,12 @@ release_content = { "released_at": released_at, } -release_url = re.compile( - rf"http://localhost/api/v4/projects/1/releases/{encoded_tag_name}" -) +release_url = re.compile(rf"http://localhost/api/v4/projects/1/releases/{tag_name}") links_url = re.compile( - rf"http://localhost/api/v4/projects/1/releases/{encoded_tag_name}/assets/links" + rf"http://localhost/api/v4/projects/1/releases/{tag_name}/assets/links" ) link_id_url = re.compile( - rf"http://localhost/api/v4/projects/1/releases/{encoded_tag_name}/assets/links/1" + rf"http://localhost/api/v4/projects/1/releases/{tag_name}/assets/links/1" ) |