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:
authorBob Van Landuyt <bob@vanlanduyt.co>2018-05-02 21:25:21 +0300
committerBob Van Landuyt <bob@vanlanduyt.co>2018-05-04 14:54:43 +0300
commit39916fdfeddfd75279d13fa976fdb07f3b9b0e26 (patch)
tree3a05cbb5816d582a72197e417d3fc3539dd6cf59 /spec/controllers/sessions_controller_spec.rb
parent7684217d6806408cd338260119364419260d1720 (diff)
Reuses `InternalRedirect` when possible
`InternalRedirect` prevents Open redirect issues by only allowing redirection to paths on the same host. It cleans up any unwanted strings from the path that could point to another host (fe. //about.gitlab.com/hello). While preserving the querystring and fragment of the uri. It is already used by: - `TermsController` - `ContinueParams` - `ImportsController` - `ForksController` - `SessionsController`: Only for verifying the host in CE. EE allows redirecting to a different instance using Geo.
Diffstat (limited to 'spec/controllers/sessions_controller_spec.rb')
-rw-r--r--spec/controllers/sessions_controller_spec.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/spec/controllers/sessions_controller_spec.rb b/spec/controllers/sessions_controller_spec.rb
index 55bd4352bd3..555b186fe31 100644
--- a/spec/controllers/sessions_controller_spec.rb
+++ b/spec/controllers/sessions_controller_spec.rb
@@ -265,7 +265,7 @@ describe SessionsController do
it 'redirects correctly for referer on same host with params' do
search_path = '/search?search=seed_project'
allow(controller.request).to receive(:referer)
- .and_return('http://%{host}%{path}' % { host: Gitlab.config.gitlab.host, path: search_path })
+ .and_return('http://%{host}%{path}' % { host: 'test.host', path: search_path })
get(:new, redirect_to_referer: :yes)