Process destination_domain only when domain-scoped destination redirects are allowed (3.x)

Fixes https://www.drupal.org/project/domain/issues/3642276 (3.x backport)

DomainSubscriber processes destination_domain only when "Allow domain-scoped destination redirects" is on, like DomainPathProcessor, which adds the parameter to outbound links only then. With the setting off (the default), the request stays as it is, and destination keeps its usual same-site meaning. The setting is read only for the requests that carry both destination_domain and destination.

Tests

DomainDestinationSecurityTest turns the setting on for its existing cases, and the new testIgnoredWhenNotAllowed() checks that with the setting off the destination is not rewritten. It fails without the fix.

Release notes

destination_domain is only processed when "Allow domain-scoped destination redirects" is on. Sites that build destination_domain links themselves need that setting.

AI-Generated: Yes (Claude Code wrote the change, its test and this description. I reviewed them.)

Merge request reports

Loading
Loading