If the referer is not set, use fullpath.
This commit is contained in:
parent
cfde0936ea
commit
9714061bb0
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue