Make redirect.destination service update request

Created on 25 December 2015, about 9 years ago
Updated 25 June 2023, over 1 year ago

Problem/Motivation

Currently when controller returns redirect response the destination still takes over, causing controller to update request object. That's because of code in \Drupal\Core\EventSubscriber\RedirectResponseSubscriber::checkRedirectUrl()

      $destination = $request->query->get('destination');
      if ($destination) {
        // The 'Location' HTTP header must always be absolute.
        $destination = $this->getDestinationAsAbsoluteUrl($destination, $request->getSchemeAndHttpHost());
        try {
          $response->setTargetUrl($destination);

Proposed resolution

Make a destination service to update request object or document current behaviour

Remaining tasks

decide on approach, review patch

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Closed: duplicate

Version

11.0 πŸ”₯

Component
RoutingΒ  β†’

Last updated 3 days ago

Created by

πŸ‡«πŸ‡·France andypost

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024