Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarin Jankovski <marin@gitlab.com>2014-07-21 17:45:27 +0400
committerMarin Jankovski <marin@gitlab.com>2014-07-21 17:45:27 +0400
commit9714061bb0f099f3800ffdc75bc8807ee783e32a (patch)
tree0fc746c810639b36ad5258b7a4c85facb1c681f9
parentcfde0936ea20edab82081c3f1288098c882e7de9 (diff)
If the referer is not set, use fullpath.
-rw-r--r--app/controllers/sessions_controller.rb9
-rw-r--r--features/steps/project/redirects.rb1
2 files changed, 9 insertions, 1 deletions
diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb
index 9b7bd94c3a2..3f896f46c6c 100644
--- a/app/controllers/sessions_controller.rb
+++ b/app/controllers/sessions_controller.rb
@@ -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
diff --git a/features/steps/project/redirects.rb b/features/steps/project/redirects.rb
index 25d37fd7888..7e01735af95 100644
--- a/features/steps/project/redirects.rb
+++ b/features/steps/project/redirects.rb
@@ -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