Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
63dac853
Commit
63dac853
authored
Feb 04, 2017
by
blackst0ne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed redirection from
http://someproject.git
to
http://someproject
parent
fd46fb1c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
1 deletion
+16
-1
app/controllers/projects/application_controller.rb
app/controllers/projects/application_controller.rb
+1
-1
changelogs/unreleased/git_to_html_redirection.yml
changelogs/unreleased/git_to_html_redirection.yml
+4
-0
spec/controllers/projects_controller_spec.rb
spec/controllers/projects_controller_spec.rb
+11
-0
No files found.
app/controllers/projects/application_controller.rb
View file @
63dac853
...
@@ -18,7 +18,7 @@ class Projects::ApplicationController < ApplicationController
...
@@ -18,7 +18,7 @@ class Projects::ApplicationController < ApplicationController
# to
# to
# localhost/group/project
# localhost/group/project
#
#
if
id
=~
/\.git\Z/
if
params
[
:format
]
==
'git'
redirect_to
request
.
original_url
.
gsub
(
/\.git\/?\Z/
,
''
)
redirect_to
request
.
original_url
.
gsub
(
/\.git\/?\Z/
,
''
)
return
return
end
end
...
...
changelogs/unreleased/git_to_html_redirection.yml
0 → 100644
View file @
63dac853
---
title
:
Redirect http://someproject.git to http://someproject
merge_request
:
author
:
blackst0ne
spec/controllers/projects_controller_spec.rb
View file @
63dac853
...
@@ -213,6 +213,17 @@ describe ProjectsController do
...
@@ -213,6 +213,17 @@ describe ProjectsController do
expect
(
response
.
status
).
to
eq
404
expect
(
response
.
status
).
to
eq
404
end
end
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
end
describe
"#update"
do
describe
"#update"
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment