Skip to content
Snippets Groups Projects
Commit bd5bb6ee authored by Rémy Coutable's avatar Rémy Coutable
Browse files

Merge branch '42231-protected-branches-api-route-returns-404-for-branches-with-dots' into 'master'

Resolve "Protected branches API route returns 404 for branches with dots"

Closes #42231

See merge request gitlab-org/gitlab-ce!16591
parents 8bea2a70 5a160b05
No related branches found
No related tags found
No related merge requests found
---
title: Fix protected branches API to accept name parameter with dot
merge_request:
author:
type: fixed
Loading
Loading
@@ -2,7 +2,7 @@ module API
class ProtectedBranches < Grape::API
include PaginationParams
 
BRANCH_ENDPOINT_REQUIREMENTS = API::PROJECT_ENDPOINT_REQUIREMENTS.merge(branch: API::NO_SLASH_URL_PART_REGEX)
BRANCH_ENDPOINT_REQUIREMENTS = API::PROJECT_ENDPOINT_REQUIREMENTS.merge(name: API::NO_SLASH_URL_PART_REGEX)
 
before { authorize_admin_project }
 
Loading
Loading
Loading
Loading
@@ -80,6 +80,12 @@ describe API::ProtectedBranches do
 
it_behaves_like 'protected branch'
end
context 'when protected branch contains a period' do
let(:protected_name) { 'my.feature' }
it_behaves_like 'protected branch'
end
end
 
context 'when authenticated as a guest' do
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment