Problem/Motivation

If you make a request to for a route which is a redirect to the decoupled router the fragment potion of the URL will be removed. This can and should be maintained.

This is a per the RFC https://www.rfc-editor.org/rfc/rfc7231#section-7.1.2

If the Location value provided in a 3xx (Redirection) response does
not have a fragment component, a user agent MUST process the
redirection as if the value inherits the fragment component of the
URI reference used to generate the request target (i.e., the
redirection inherits the original reference's fragment, if any).

Note that the Redirect module doesn't have to worry about this because this happens at the browser level but it is different for the decoupled router.

Steps to reproduce

Make a request with a path that redirects and add a fragment.

Proposed resolution

Preserve the fragment unless the redirect adds one.

Remaining tasks

User interface changes

None

API changes

None

Data model changes

None

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

alexpott created an issue. See original summary.

alexpott’s picture

#3543594: Redirects to URLs with query strings and redirect query passthrough enabled is broken rewrites the redirect event listener so this will be addressed once that one has landed.

alexpott’s picture

Status: Active » Needs review

This is ready for review now.

mglaman’s picture

Status: Needs review » Fixed

Added to the merge train! Thanks

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.

  • mglaman committed 70d03b37 on 2.x authored by alexpott
    [#3545398] feat: Redirect event listener should preserve the fragment...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.