From c04a30988b7fa247de37c27c81537355171da28f Mon Sep 17 00:00:00 2001 From: "y.gallice" Date: Wed, 7 Sep 2022 12:52:01 +0200 Subject: [PATCH 1/2] Add URL-encoding when submitting a branch name for deletion --- src/GitLabApiClient/BranchClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GitLabApiClient/BranchClient.cs b/src/GitLabApiClient/BranchClient.cs index 2746d61b..b3295de4 100644 --- a/src/GitLabApiClient/BranchClient.cs +++ b/src/GitLabApiClient/BranchClient.cs @@ -62,7 +62,7 @@ public async Task CreateAsync(ProjectId projectId, CreateBranchRequest r /// The ID, path or of the project. /// The branch, you want deleted. public async Task DeleteBranch(ProjectId projectId, string branchName) => - await _httpFacade.Delete($"projects/{projectId}/repository/branches/{branchName}"); + await _httpFacade.Delete($"projects/{projectId}/repository/branches/{branchName.UrlEncode()}"); /// /// Deletes the merged branches From 09a49d3fc7616679d71c86997581715247f5f188 Mon Sep 17 00:00:00 2001 From: "y.gallice" Date: Wed, 7 Sep 2022 12:52:01 +0200 Subject: [PATCH 2/2] Add URL-encoding when submitting a branch name for deletion --- src/GitLabApiClient/BranchClient.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/GitLabApiClient/BranchClient.cs b/src/GitLabApiClient/BranchClient.cs index 2746d61b..4ff936ac 100644 --- a/src/GitLabApiClient/BranchClient.cs +++ b/src/GitLabApiClient/BranchClient.cs @@ -4,6 +4,7 @@ using GitLabApiClient.Internal.Http; using GitLabApiClient.Internal.Paths; using GitLabApiClient.Internal.Queries; +using GitLabApiClient.Internal.Utilities; using GitLabApiClient.Models.Branches.Requests; using GitLabApiClient.Models.Branches.Responses; using GitLabApiClient.Models.Projects.Responses; @@ -62,7 +63,7 @@ public async Task CreateAsync(ProjectId projectId, CreateBranchRequest r /// The ID, path or of the project. /// The branch, you want deleted. public async Task DeleteBranch(ProjectId projectId, string branchName) => - await _httpFacade.Delete($"projects/{projectId}/repository/branches/{branchName}"); + await _httpFacade.Delete($"projects/{projectId}/repository/branches/{branchName.UrlEncode()}"); /// /// Deletes the merged branches