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
dd868c4d
Commit
dd868c4d
authored
Oct 23, 2020
by
Francisco Javier López
Committed by
Alper Akgun
Oct 23, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change permanent routable redirect to 301
parent
68ff9957
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
7 deletions
+12
-7
app/controllers/concerns/routable_actions.rb
app/controllers/concerns/routable_actions.rb
+1
-1
changelogs/unreleased/fj-change-routable-redirect-to-301.yml
changelogs/unreleased/fj-change-routable-redirect-to-301.yml
+5
-0
ee/spec/controllers/projects/integrations/jira/issues_controller_spec.rb
...lers/projects/integrations/jira/issues_controller_spec.rb
+1
-1
spec/controllers/projects/issues_controller_spec.rb
spec/controllers/projects/issues_controller_spec.rb
+3
-3
spec/controllers/projects/merge_requests_controller_spec.rb
spec/controllers/projects/merge_requests_controller_spec.rb
+2
-2
No files found.
app/controllers/concerns/routable_actions.rb
View file @
dd868c4d
...
...
@@ -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."
end
redirect_to
build_canonical_path
(
routable
)
redirect_to
build_canonical_path
(
routable
)
,
status: :moved_permanently
end
end
end
...
...
changelogs/unreleased/fj-change-routable-redirect-to-301.yml
0 → 100644
View file @
dd868c4d
---
title
:
Change permanent routable redirect to
301
merge_request
:
45980
author
:
type
:
changed
ee/spec/controllers/projects/integrations/jira/issues_controller_spec.rb
View file @
dd868c4d
...
...
@@ -49,7 +49,7 @@ RSpec.describe Projects::Integrations::Jira::IssuesController do
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
have_gitlab_http_status
(
:
found
)
expect
(
response
).
to
have_gitlab_http_status
(
:
moved_permanently
)
end
end
...
...
spec/controllers/projects/issues_controller_spec.rb
View file @
dd868c4d
...
...
@@ -52,14 +52,14 @@ RSpec.describe Projects::IssuesController do
get
:index
,
params:
{
namespace_id:
project
.
namespace
,
project_id:
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
it
'redirects from an old issue correctly'
do
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
have_gitlab_http_status
(
:
found
)
expect
(
response
).
to
have_gitlab_http_status
(
:
moved_permanently
)
end
end
end
...
...
@@ -1869,7 +1869,7 @@ RSpec.describe Projects::IssuesController do
}
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
...
...
spec/controllers/projects/merge_requests_controller_spec.rb
View file @
dd868c4d
...
...
@@ -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
have_gitlab_http_status
(
:
found
)
expect
(
response
).
to
have_gitlab_http_status
(
:
moved_permanently
)
end
it
'redirects from an old merge request commits correctly'
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
have_gitlab_http_status
(
:
found
)
expect
(
response
).
to
have_gitlab_http_status
(
:
moved_permanently
)
end
end
end
...
...
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