ConfigSplitDiffController::diff incorrectly redirects to 'system.404' instead of generating a 404 response

Created on 19 December 2024, 4 months ago

Problem/Motivation

In ConfigSplitDiffController::diff() if the requested split is not found or the operation is unknown, it returns $this->redirect('system.404');. This has the effect of redirecting you to the system 404 page, but generates HTTP responses of 302 (for the redirect) and then 200 (for arriving at the page), when it should instead generate code 404.

Steps to reproduce

  1. Log in as admin.
  2. In your browser, open the web developer tools and go to the Network tab (or whatever your browser calls it).
  3. Visit an invalid config split diff URL, such as /admin/config/development/configuration/config-split/config_split.config_split.UNKNOWN_SPLIT/activate/diff/block.block.masquerade_5
  4. Observe the HTTP responses generated for the request.

Expected result: HTTP 404
Actual result: HTTP 302 for the initial request, followed by HTTP 200 for the 404 page (/system/404).

Proposed resolution

Throw NotFoundHttpException instead.

πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States muriqui

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