Commit 99594281 authored by Max Woolf's avatar Max Woolf

Merge branch 'jejacks0n/add_dev_domains_to_redirect_validation' into 'master'

Add development-ish domains to redirect validation

See merge request gitlab-org/gitlab!74642
parents 720f9697 40903a98
...@@ -42,7 +42,7 @@ Gitlab::Experiment.configure do |config| ...@@ -42,7 +42,7 @@ Gitlab::Experiment.configure do |config|
# This behavior doesn't make perfect sense for self managed installs either, # This behavior doesn't make perfect sense for self managed installs either,
# so we don't think we should redirect in those cases. # so we don't think we should redirect in those cases.
# #
valid_domains = %w[about.gitlab.com docs.gitlab.com gitlab.com] valid_domains = %w[about.gitlab.com docs.gitlab.com gitlab.com gdk.test localhost]
config.redirect_url_validator = lambda do |url| config.redirect_url_validator = lambda do |url|
Gitlab.dev_env_or_com? && (url = URI.parse(url)) && valid_domains.include?(url.host) Gitlab.dev_env_or_com? && (url = URI.parse(url)) && valid_domains.include?(url.host)
rescue URI::InvalidURIError rescue URI::InvalidURIError
......
...@@ -263,6 +263,8 @@ RSpec.describe ApplicationExperiment, :experiment do ...@@ -263,6 +263,8 @@ RSpec.describe ApplicationExperiment, :experiment do
"https://badplace.com\nhttps://gitlab.com" | nil "https://badplace.com\nhttps://gitlab.com" | nil
'https://gitlabbcom' | nil 'https://gitlabbcom' | nil
'https://gitlabbcom/' | nil 'https://gitlabbcom/' | nil
'http://gdk.test/foo/bar' | 'http://gdk.test/foo/bar'
'http://localhost:3000/foo/bar' | 'http://localhost:3000/foo/bar'
end end
with_them do with_them do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment