Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5d9c198

Browse files
fix: ensure path elements are escaped
Ensure the path elements that are passed to the server are escaped.For example a "/" will be changed to "%2F"Closes:#2116
1 parentca3b438 commit5d9c198

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

‎gitlab/base.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -380,10 +380,12 @@ def _compute_path(self, path: Optional[str] = None) -> Optional[str]:
380380
ifself._parentisNoneornotself._from_parent_attrs:
381381
returnpath
382382

383-
data= {
384-
self_attr:getattr(self._parent,parent_attr,None)
385-
forself_attr,parent_attrinself._from_parent_attrs.items()
386-
}
383+
data:Dict[str,Optional[gitlab.utils.EncodedId]]= {}
384+
forself_attr,parent_attrinself._from_parent_attrs.items():
385+
ifnothasattr(self._parent,parent_attr):
386+
data[self_attr]=None
387+
continue
388+
data[self_attr]=gitlab.utils.EncodedId(getattr(self._parent,parent_attr))
387389
self._parent_attrs=data
388390
returnpath.format(**data)
389391

‎tests/functional/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ def project_file(project):
391391
@pytest.fixture(scope="function")
392392
defrelease(project,project_file):
393393
_id=uuid.uuid4().hex
394-
name=f"test-release-{_id}"
394+
name=f"we_have_a_slash/test-release-{_id}"
395395

396396
project.refresh()# Gets us the current default branch
397397
release=project.releases.create(

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp