Redirect breaks on 304 and 305 redirect status

Created on 1 February 2021, almost 4 years ago
Updated 25 September 2024, 3 months ago

Problem

Setting a redirect with redirect status 304 or 305 breaks the functionality:
InvalidArgumentException: The HTTP status code is not a redirect ("304" given). in Symfony\Component\HttpFoundation\RedirectResponse
InvalidArgumentException: The HTTP status code is not a redirect ("305" given). in Symfony\Component\HttpFoundation\RedirectResponse

Steps to reproduce

1- Create one redirect with code 304 or 305.
2- Use the created redirect.

🐛 Bug report
Status

Postponed

Version

1.0

Component

Code

Created by

🇸🇮Slovenia jjtoyas

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

Merge Requests

Comments & Activities

Not all content is available!

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

  • First commit to issue fork.
  • Pipeline finished with Success
    3 months ago
    Total: 182s
    #292341
  • 🇳🇱Netherlands timohuisman Leiden, Netherlands

    I just came across this issue because a client of us selected a 304 for a redirect. A 304 is not a valid redirect code according to the Symfony docs. I've updated the Issue summary and created a MR with the proposed solution.

    Attached is a patch file containing the current state of the MR, so it can be safely used with composer-patches.

Production build 0.71.5 2024