Commit 88e76a47 authored by Nick Thomas's avatar Nick Thomas

Merge branch 'alipniagov/add-route-for-project-import-via-ui-acceleration' into 'master'

Add route for project imports direct upload via UI

See merge request gitlab-org/gitlab-workhorse!470
parents a8e850fb 2771054a
......@@ -50,6 +50,7 @@ const (
projectPattern = `^/([^/]+/){1,}[^/]+/`
snippetUploadPattern = `^/uploads/personal_snippet`
userUploadPattern = `^/uploads/user`
importPattern = `^/import/`
)
func compileRegexp(regexpStr string) *regexp.Regexp {
......@@ -218,6 +219,9 @@ func (u *upstream) configureRoutes() {
route("POST", apiPattern+`v4/groups/import`, upload.Accelerate(api, signingProxy)),
route("POST", apiPattern+`v4/projects/import`, upload.Accelerate(api, signingProxy)),
// Project Import via UI upload acceleration
route("POST", importPattern+`gitlab_project`, upload.Accelerate(api, signingProxy)),
// Explicitly proxy API requests
route("", apiPattern, proxy),
route("", ciAPIPattern, proxy),
......
......@@ -138,6 +138,7 @@ func TestAcceleratedUpload(t *testing.T) {
{"PUT", "/api/v4/projects/9001/packages/nuget/v1/files", true},
{"POST", `/api/v4/groups/import`, true},
{"POST", `/api/v4/projects/import`, true},
{"POST", `/import/gitlab_project`, true},
}
for _, tt := range tests {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment