Fix regexp matching when using API with group/project syntax
Compare changes
Files
+ 3
− 1
@@ -50,7 +50,9 @@ const projectPattern = `^/[^/]+/[^/]+/`
Do not update/delete: Banner broadcast message test data
Do not update/delete: Notification broadcast message test data
Projects can be specified in two ways:
Here's the issue: by the time gitlab-workhorse receives the query, the %2F
is decoded into a slash, and so gitlab-workhorse sees:
/api/v3/projects/:group_name/:project_name/repository/archive
In 0.4.2, the regex just attempted to match the last part of the URL: repository/archive
. In 0.5.0, the anchor ^
forces the API endpoint regexp to match the following form:
/api/v3/projects/:project_id/repository/archive
The extra slash throws the regexp off and causes gitlab-workhorse to forward the request along.
Closes gitlab-org/gitlab-ce#4124