Content is not well-formed on 404 page

Created on 28 September 2018, over 5 years ago
Updated 4 December 2023, 7 months ago

When visiting a 404 page, CSS files are not well written into the response object. I've found out that the KernelEvents::RESPONSE is triggered twice and so the function deferCSS is also executed twice. The first time everything works well, but the second time a <noscript></noscript> tag is placed into the content again.

My suggestion is to add a check in the InitSubscriber to check if the request type is a Master Request. But I don't know if this is the best solution and if something else can go wrong.

if ($response->getRequestType() !== HttpKernelInterface::MASTER_REQUEST) {
  return;
}
πŸ› Bug report
Status

Needs review

Version

4.1

Component

Modifier

Created by

πŸ‡³πŸ‡±Netherlands Martijn Snapper

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

Comments & Activities

Not all content is available!

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

Production build 0.69.0 2024