BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
5a160b05
Commit
5a160b05
authored
Jan 19, 2018
by
Mark Fletcher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix protected branches API to accept name parameter with dot
parent
ee587631
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
1 deletion
+12
-1
42231-protected-branches-api-route-returns-404-for-branches-with-dots.yml
...branches-api-route-returns-404-for-branches-with-dots.yml
+5
-0
protected_branches.rb
lib/api/protected_branches.rb
+1
-1
protected_branches_spec.rb
spec/requests/api/protected_branches_spec.rb
+6
-0
No files found.
changelogs/unreleased/42231-protected-branches-api-route-returns-404-for-branches-with-dots.yml
0 → 100644
View file @
5a160b05
---
title
:
Fix protected branches API to accept name parameter with dot
merge_request
:
author
:
type
:
fixed
lib/api/protected_branches.rb
View file @
5a160b05
...
...
@@ -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
}
...
...
spec/requests/api/protected_branches_spec.rb
View file @
5a160b05
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment