summaryrefslogtreecommitdiff
path: root/lib/api
diff options
context:
space:
mode:
authorDan Tudor <dtudor01@gmail.com>2015-03-24 13:04:22 +0000
committerDan Tudor <dtudor01@gmail.com>2015-03-24 13:04:22 +0000
commit862e1e6f178d11473319225de51c25b72174f45b (patch)
tree2eb0d64d51c7f08abf02c6f35218765393d375a1 /lib/api
parentc3c9703437a552700c2a6ca010b05cc56aa6d73a (diff)
downloadgitlab-ce-862e1e6f178d11473319225de51c25b72174f45b.tar.gz
Unescape branch param to delete
Branch names that contain `/` return a 405 error when being deleted because the slash is escaped to `%2F` This patch will unescape the param prior to executing the delete action.
Diffstat (limited to 'lib/api')
-rw-r--r--lib/api/branches.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/api/branches.rb b/lib/api/branches.rb
index b52d786e020..edfdf842f85 100644
--- a/lib/api/branches.rb
+++ b/lib/api/branches.rb
@@ -1,4 +1,5 @@
require 'mime/types'
+require 'uri'
module API
# Projects API
@@ -103,7 +104,7 @@ module API
delete ":id/repository/branches/:branch" do
authorize_push_project
result = DeleteBranchService.new(user_project, current_user).
- execute(params[:branch])
+ execute(URI.unescape(params[:branch]))
if result[:status] == :success
{