Redirect event listener should preserve the fragment

Created on 8 September 2025, about 1 month ago

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

πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024