Skip to content

Commit

Permalink
Merge pull request #2510 from alphagov/allow-redirects-to-caa
Browse files Browse the repository at this point in the history
Allow external redirects to caa.co.uk
  • Loading branch information
ollietreend authored Sep 22, 2023
2 parents 41966ad + 38dc1c7 commit 173d4b7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/validators/routes_and_redirects_validator.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
class RoutesAndRedirectsValidator < ActiveModel::Validator
EXTERNAL_HOST_ALLOW_LIST = %w[
.caa.co.uk
.gov.uk
.judiciary.uk
.nationalhighways.co.uk
Expand Down Expand Up @@ -198,7 +199,7 @@ def validate_external_redirect(destination)
return
end

errors.add(:redirects, "external redirects only accepted within the gov.uk, judiciary.uk, nhs.uk or ukri.org domains") unless
errors.add(:redirects, "external redirects only accepted for the domains #{EXTERNAL_HOST_ALLOW_LIST.to_sentence}") unless
government_domain?(uri.host)

errors.add(:redirects, "internal redirect should not be specified with full url") if
Expand Down

0 comments on commit 173d4b7

Please sign in to comment.