Skip to content

Commit

Permalink
[api] Don't infloop in delete_project_pubkey
Browse files Browse the repository at this point in the history
  • Loading branch information
andreas-schwab authored and coolo committed Nov 20, 2013
1 parent 775b9c4 commit b444bfe
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/api/app/controllers/source_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,9 @@ def delete_project_pubkey
pass_to_backend path
return
end
if not upperProject.include? ':'
break
end
upperProject = upperProject.gsub(/:[^:]*$/, '')
end

Expand Down
13 changes: 13 additions & 0 deletions src/api/test/functional/source_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1883,6 +1883,19 @@ def test_public_keys
delete '/source/kde4/_pubkey'
assert_response 403

login_king
subprojectmeta="<project name='DoesNotExist:subproject'><title></title><description/></project>"
put url_for(:controller => :source, :action => :update_project_meta, :project => 'DoesNotExist:subproject'), subprojectmeta
assert_response :success

delete '/source/DoesNotExist:subproject/_pubkey'
assert_response :success

delete '/source/DoesNotExist:subproject'
assert_response :success

login_tom

# FIXME: make a successful deletion of a key

# via new _project route
Expand Down

0 comments on commit b444bfe

Please sign in to comment.