URL Encoding - Rename repository
Overview
Including non-ASCII chars in a project name when attempting to "rename" under settings results in an internal error
Reproduce
- Create a new project
- Navigate to project settings
- In the "rename repository" section, rename to include non-ASCII chars (# &)
Expected
The change is rejected and an appropriate error message is displayed.
Actual
500 internal error is displayed
Trace
ActionView::Template::Error (No route matches {:action=>"show", :controller=>"projects", :id=>#<Project id: 1, name: "test-project", path: "test-project-#-&", description: "", created_at: "2016-05-26 01:04:18", updated_at: "2016-07-01 07:44:35", creator_id: 1, issues_enabled: true, merge_requests_enabled: true, wiki_enabled: true, namespace_id: 1, snippets_enabled: false, last_activity_at: "2016-07-01 07:44:35", import_url: "", visibility_level: 20, archived: false, avatar: nil, import_status: "none", repository_size: 0.27, merge_requests_template: "", star_count: 0, merge_requests_rebase_enabled: false, import_type: nil, import_source: nil, approvals_before_merge: 0, reset_approvals_on_push: true, commit_count: 6, merge_requests_ff_only_enabled: false, issues_template: "", mirror: false, mirror_last_update_at: nil, mirror_last_successful_update_at: nil, mirror_user_id: 1, import_error: nil, ci_id: nil, builds_enabled: true, shared_runners_enabled: true, runners_token: "REMOVED", build_coverage_regex: "", build_allow_git_fetch: true, build_timeout: 3600, mirror_trigger_builds: false, pending_delete: false, public_builds: true, pushes_since_gc: 0, last_repository_check_failed: false, last_repository_check_at: "2016-06-30 03:20:21", container_registry_enabled: nil, only_allow_merge_if_build_succeeds: false, has_external_issue_tracker: false>, :namespace_id=>#<Namespace id: 1, name: "REMOVED", path: "REMOVED", owner_id: 1, created_at: "2016-05-26 00:50:23", updated_at: "2016-05-26 00:50:23", type: nil, description: "", avatar: nil, membership_lock: false, share_with_group_lock: false, visibility_level: 20, last_ldap_sync_at: nil>} missing required keys: [:id]):
4: %h4.prepend-top-0
5: Project settings
6: .col-lg-9
7: = form_for [@project.namespace.becomes(Namespace), @project], remote: true, html: { multipart: true, class: "edit-project" }, authenticity_token: true do |f|
8: %fieldset.append-bottom-0
9: .form-group
10: = f.label :name, class: 'label-light' do
app/views/projects/edit.html.haml:7:in `_app_views_projects_edit_html_haml___2475511026331490773_170729240'
app/controllers/projects_controller.rb:57:in `block (2 levels) in update'
app/controllers/projects_controller.rb:46:in `update'
lib/gitlab/middleware/go.rb:16:in `call'
lib/gitlab/middleware/readonly_geo.rb:29:in `call'
//cc @jameslopez