Merge branch 'use_fullpath' into 'master'
If referer in request is incorrect use fullpath Fixes #1444 See merge request !982
This commit is contained in:
commit
98c66b508c
|
@ -1,9 +1,18 @@
|
||||||
class SessionsController < Devise::SessionsController
|
class SessionsController < Devise::SessionsController
|
||||||
|
|
||||||
def new
|
def new
|
||||||
if request.referer.present?
|
redirect_url = if request.referer.present?
|
||||||
store_location_for(:redirect, URI(request.referer).path)
|
referer_uri = URI(request.referer)
|
||||||
end
|
if referer_uri.host == Gitlab.config.gitlab.host
|
||||||
|
referer_uri.path
|
||||||
|
else
|
||||||
|
request.fullpath
|
||||||
|
end
|
||||||
|
else
|
||||||
|
request.fullpath
|
||||||
|
end
|
||||||
|
|
||||||
|
store_location_for(:redirect, redirect_url)
|
||||||
|
|
||||||
super
|
super
|
||||||
end
|
end
|
||||||
|
|
|
@ -17,6 +17,7 @@ class Spinach::Features::ProjectRedirects < Spinach::FeatureSteps
|
||||||
end
|
end
|
||||||
|
|
||||||
step 'I should see project "Community" home page' do
|
step 'I should see project "Community" home page' do
|
||||||
|
Gitlab.config.gitlab.stub(:host).and_return("www.example.com")
|
||||||
within '.project-home-title' do
|
within '.project-home-title' do
|
||||||
page.should have_content 'Community'
|
page.should have_content 'Community'
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue