Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
1c088017
Commit
1c088017
authored
Nov 02, 2016
by
Nick Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow nested namespaces in git URLs
parent
c8589c13
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
internal/upstream/routes.go
internal/upstream/routes.go
+6
-8
main_test.go
main_test.go
+2
-0
No files found.
internal/upstream/routes.go
View file @
1c088017
...
...
@@ -30,14 +30,12 @@ type routeEntry struct {
matchers
[]
matcherFunc
}
const
projectPattern
=
`^/[^/]+/[^/]+/`
const
gitProjectPattern
=
`^/[^/]+/[^/]+\.git/`
const
apiPattern
=
`^/api/`
// A project ID in an API request is either a number or two strings 'namespace/project'
const
projectsAPIPattern
=
`^/api/v3/projects/((\d+)|([^/]+/[^/]+))/`
const
ciAPIPattern
=
`^/ci/api/`
const
(
apiPattern
=
`^/api/`
ciAPIPattern
=
`^/ci/api/`
gitProjectPattern
=
`^/([^/]+/){1,}[^/]+\.git/`
projectPattern
=
`^/([^/]+/){1,}[^/]+/`
)
func
compileRegexp
(
regexpStr
string
)
*
regexp
.
Regexp
{
if
len
(
regexpStr
)
==
0
{
...
...
main_test.go
View file @
1c088017
...
...
@@ -178,6 +178,8 @@ func TestRegularProjectsAPI(t *testing.T) {
"/api/v3/projects/foo%2Fbar/repository/not/special"
,
"/api/v3/projects/123/not/special"
,
"/api/v3/projects/foo%2Fbar/not/special"
,
"/api/v3/projects/foo%2Fbar%2Fbaz/repository/not/special"
,
"/api/v3/projects/foo%2Fbar%2Fbaz%2Fqux/repository/not/special"
,
}
{
resp
,
err
:=
http
.
Get
(
ws
.
URL
+
resource
)
if
err
!=
nil
{
...
...
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