Skip to content
Snippets Groups Projects
Commit 98c66b50 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Merge branch 'use_fullpath' into 'master'

If referer in request is incorrect use fullpath

Fixes #1444

See merge request !982
parents 4f47eaf9 b4217500
No related branches found
No related tags found
No related merge requests found
class SessionsController < Devise::SessionsController
 
def new
if request.referer.present?
store_location_for(:redirect, URI(request.referer).path)
end
redirect_url = if request.referer.present?
referer_uri = URI(request.referer)
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
end
Loading
Loading
Loading
Loading
@@ -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
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment