404 page for an image style url sends incorrect headers

Created on 11 January 2016, almost 9 years ago
Updated 7 June 2024, 7 months ago

Steps to reproduce

  1. Upload a file to drupal
  2. Delete the file from the file system.
  3. Try to access an image style derivative for that file (n.b. make sure the derivative wasn't already created before deleting the original file.)

Expected behaviour

I should see a 404 page.

What happens?

The 404 page html is sent but headers relating to the file are used (e.g. content length and content type). This means that the page isn't displayed in chrome of firefox. Worse though, if the content length of the image is longer than the page then the browser will hold the connection open waiting for more data to be sent. If there are multiple images like this on the page it can quickly saturate the browsers TCP connection per domain limit and block other requests from succeeding.

Proposed solution

We should wait until we know the generation of the image derivative is successful before setting the related HTTP headers.

πŸ› Bug report
Status

Closed: outdated

Version

7.0 ⚰️

Component
Image systemΒ  β†’

Last updated 1 day ago

Created by

πŸ‡¬πŸ‡§United Kingdom Dean Reilly

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.71.5 2024