Add meta tag to HTML output to make it obvious 404 page was generated by fast 404 generator

Created on 7 May 2025, 8 days ago

Problem/Motivation

Writing some automated tests to make sure we're hitting the Fast 404 page. You can't discern the fast 404 page from a normally generated 404 page, and so adding a metatag will make life easy.

Steps to reproduce

-Trigger a 404 response
-Tell me with absolute confidence that is the the generated 404 (you can't?)

Proposed resolution

Add a meta tag to the generated 404 HTML.

Remaining tasks

User interface changes

API changes

Data model changes

✨ Feature request
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States jnicola

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

Comments & Activities

  • Issue created by @jnicola
  • πŸ‡ΊπŸ‡ΈUnited States jnicola

    Attached is my not terribly graceful patch that modifies Fast404GeneratorSubscriber::onKernelResponse to instead of writing the HTML content all in one line instead takes the response, saves it to a variable, and does a very ungraceful string replace that takes and rewrites it with and the meta tag prior to it.

    Now you can discern fast 404 generated HTML from standard HTML with confidence and test against it. Woo. Hoo.

  • πŸ‡ΊπŸ‡ΈUnited States pookmish

    I like this idea. I've committed your patch.

Production build 0.71.5 2024