Commit dd868c4d authored by Francisco Javier López's avatar Francisco Javier López Committed by Alper Akgun

Change permanent routable redirect to 301

parent 68ff9957
...@@ -51,7 +51,7 @@ module RoutableActions ...@@ -51,7 +51,7 @@ module RoutableActions
flash[:notice] = "#{routable.class.to_s.titleize} '#{requested_full_path}' was moved to '#{canonical_path}'. Please update any links and bookmarks that may still have the old path." flash[:notice] = "#{routable.class.to_s.titleize} '#{requested_full_path}' was moved to '#{canonical_path}'. Please update any links and bookmarks that may still have the old path."
end end
redirect_to build_canonical_path(routable) redirect_to build_canonical_path(routable), status: :moved_permanently
end end
end end
end end
......
---
title: Change permanent routable redirect to 301
merge_request: 45980
author:
type: changed
...@@ -49,7 +49,7 @@ RSpec.describe Projects::Integrations::Jira::IssuesController do ...@@ -49,7 +49,7 @@ RSpec.describe Projects::Integrations::Jira::IssuesController do
get :index, params: { namespace_id: project.namespace, project_id: project } get :index, params: { namespace_id: project.namespace, project_id: project }
expect(response).to redirect_to(project_integrations_jira_issues_path(new_project)) expect(response).to redirect_to(project_integrations_jira_issues_path(new_project))
expect(response).to have_gitlab_http_status(:found) expect(response).to have_gitlab_http_status(:moved_permanently)
end end
end end
......
...@@ -52,14 +52,14 @@ RSpec.describe Projects::IssuesController do ...@@ -52,14 +52,14 @@ RSpec.describe Projects::IssuesController do
get :index, params: { namespace_id: project.namespace, project_id: project } get :index, params: { namespace_id: project.namespace, project_id: project }
expect(response).to redirect_to(project_issues_path(new_project)) expect(response).to redirect_to(project_issues_path(new_project))
expect(response).to have_gitlab_http_status(:found) expect(response).to have_gitlab_http_status(:moved_permanently)
end end
it 'redirects from an old issue correctly' do it 'redirects from an old issue correctly' do
get :show, params: { namespace_id: project.namespace, project_id: project, id: issue } get :show, params: { namespace_id: project.namespace, project_id: project, id: issue }
expect(response).to redirect_to(project_issue_path(new_project, issue)) expect(response).to redirect_to(project_issue_path(new_project, issue))
expect(response).to have_gitlab_http_status(:found) expect(response).to have_gitlab_http_status(:moved_permanently)
end end
end end
end end
...@@ -1869,7 +1869,7 @@ RSpec.describe Projects::IssuesController do ...@@ -1869,7 +1869,7 @@ RSpec.describe Projects::IssuesController do
} }
expect(response).to redirect_to(designs_project_issue_path(new_project, issue)) expect(response).to redirect_to(designs_project_issue_path(new_project, issue))
expect(response).to have_gitlab_http_status(:found) expect(response).to have_gitlab_http_status(:moved_permanently)
end end
end end
end end
......
...@@ -161,7 +161,7 @@ RSpec.describe Projects::MergeRequestsController do ...@@ -161,7 +161,7 @@ RSpec.describe Projects::MergeRequestsController do
} }
expect(response).to redirect_to(project_merge_request_path(new_project, merge_request)) expect(response).to redirect_to(project_merge_request_path(new_project, merge_request))
expect(response).to have_gitlab_http_status(:found) expect(response).to have_gitlab_http_status(:moved_permanently)
end end
it 'redirects from an old merge request commits correctly' do it 'redirects from an old merge request commits correctly' do
...@@ -173,7 +173,7 @@ RSpec.describe Projects::MergeRequestsController do ...@@ -173,7 +173,7 @@ RSpec.describe Projects::MergeRequestsController do
} }
expect(response).to redirect_to(commits_project_merge_request_path(new_project, merge_request)) expect(response).to redirect_to(commits_project_merge_request_path(new_project, merge_request))
expect(response).to have_gitlab_http_status(:found) expect(response).to have_gitlab_http_status(:moved_permanently)
end end
end end
end end
......
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