Commit b7685ad1 authored by Sean McGivern's avatar Sean McGivern

Merge branch 'git_to_html_redirection' into 'master'

Redirect http://someproject.git to http://someproject

Closes #26275

See merge request !8951
parents 1bf03125 63dac853
......@@ -18,7 +18,7 @@ class Projects::ApplicationController < ApplicationController
# to
# localhost/group/project
#
if id =~ /\.git\Z/
if params[:format] == 'git'
redirect_to request.original_url.gsub(/\.git\/?\Z/, '')
return
end
......
---
title: Redirect http://someproject.git to http://someproject
merge_request:
author: blackst0ne
......@@ -213,6 +213,17 @@ describe ProjectsController do
expect(response.status).to eq 404
end
end
context "redirection from http://someproject.git" do
it 'redirects to project page (format.html)' do
project = create(:project, :public)
get :show, namespace_id: project.namespace.path, id: project.path, format: :git
expect(response).to have_http_status(302)
expect(response).to redirect_to(namespace_project_path)
end
end
end
describe "#update" do
......
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