- Issue created by @B-Prod
- π±πΊLuxembourg B-Prod
The provided patch makes the "redirect_response_subscriber" to be replaced as expected, and simplify the code of the domain source event subscriber, so it relies more closely on its parent without duplicating the code.
- πΊπΈUnited States ben.hamelin Adirondack Mountains, NY
ben.hamelin β made their first commit to this issueβs fork.
- πΊπΈUnited States ben.hamelin Adirondack Mountains, NY
Thanks @b-prod for opening this issue. Confirming the patch you provided worked for me.
@mably Opened the issue branch and am doing some further testing and development. I will open the MR soon hopefully!
- Assigned to ben.hamelin
- Status changed to Postponed: needs info
about 1 month ago 5:50pm 18 August 2025 - π«π·France mably
Is it still a problem? Could we have a MR please?
- Merge request !196Issue #3517215 by ben.hamelin: The replacement of service "redirect_response_subscriber" does not work β (Closed) created by mably
- Merge request !197Issue #3517215 by ben.hamelin: The replacement of service "redirect_response_subscriber" does not work β (Merged) created by mably
- π«π·France mably
Why is it done in the
domain_source
submodule and not in the maindomain
module?I do not see any reference to some
domain_source
specific code in theDomainSourceRedirectResponseSubscriber
code. - π«π·France mably
Would be great to have more detailed instructions to help reproduce the problem.
- π«π·France mably
I recommend enabling our domain-aware
RedirectResponseSubscriber
by default to prevent potential issues with custom cross-domain redirects.MR code has been updated accordingly.
- πΊπΈUnited States ben.hamelin Adirondack Mountains, NY
@mably - I agree with the approach here to move this from domain_source into domain.
Patch applies cleanly to drupal/domain (dev-2.0.x c210cf8)I am able to add a redirect to a local domain managed by domain module.
I think this is good to go
- π«π·France mably
Added a functional test:
namespace Drupal\Tests\domain\Functional; /** * Tests the domain block visibility condition. * * @group domain */ class DomainRedirectTest extends DomainTestBase { /** * {@inheritdoc} */ protected static $modules = ['domain', 'domain_test_redirect']; /** * Test redirections. */ public function testDomainRedirect() { $this->domainCreateTestDomains(2); $domains = $this->getDomains(); $domain = $domains['one_example_com']; $target_url = $domain->getPath() . 'target-path'; $this->drupalGet('/non-trusted-redirect', [ 'query' => ['url' => $target_url], ]); $this->assertEquals($target_url, $this->getUrl()); $target_url = 'https://two.example.com'; $this->drupalGet('/non-trusted-redirect', [ 'query' => ['url' => $target_url], ]); $this->assertSession()->statusCodeEquals(400); $this->assertSession()->responseContains('Redirects to external URLs are not allowed'); } }
We should be ready to go.