Skip to content

HTTP 303 Redirects with anchor not respected #211

@rmm5t

Description

@rmm5t

Steps to Reproduce:

  • Redirect after a form submission (via HTTP 303) to a location that contains an anchor (e.g. Location: /path#anchor).

Observed Behavior:

  • The redirection occurs, but strips the anchor from the resulting page (e.g. /path instead of /path#anchor)
  • This results in any page rendering dependent upon this anchor to fail.

Expected Behavior

  • Redirect and expose the full path with the anchor in the resulting page's address bar.

Workaround

  • Disable turbo on that particular form submission.

Wild Guess Hypothesis
I suspect that the subsequent redirection fetch (from Turbo) strips the anchor tag from the underlying HTTP request (as expected), but when the page is re-hydrated, the address bar URL (pushstate) is not updated to reflect the original anchor.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions