提交 9714061b 编写于 作者: M Marin Jankovski

If the referer is not set, use fullpath.

上级 cfde0936
......@@ -2,7 +2,14 @@ class SessionsController < Devise::SessionsController
def new
if request.referer.present?
store_location_for(:redirect, URI(request.referer).path)
referer_uri = URI(request.referer)
if referer_uri.host == Gitlab.config.gitlab.host
store_location_for(:redirect, referer_uri.path)
else
store_location_for(:redirect, request.fullpath)
end
else
store_location_for(:redirect, request.fullpath)
end
super
......
......@@ -17,6 +17,7 @@ class Spinach::Features::ProjectRedirects < Spinach::FeatureSteps
end
step 'I should see project "Community" home page' do
Gitlab.config.gitlab.stub(:host).and_return("www.example.com")
within '.project-home-title' do
page.should have_content 'Community'
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册