Firefox Redirect Filename Bug

Bug #657621 is open since 2011 and not even confirmed!

Affects: Firefox for Windows, Firefox for Android. Latest stable versions (as of December 2015)

Reproduction

  1. An URL "redirect.php" redirects to an image "dolphin.jpg" using a 30x status code and a "Location" HTTP header
  2. When the user wants to save the image, the recommended file name is "redirect.php" instead of "dolphin.jpg", although "dolphin.jpg" is in the title/URL bar.

Test it yourself

Click here for a simple HTTP redirect to a picture.

After it is loaded, try to save it using Rightclick -> "Save Image as". The filename will be wrong. If you save the image as file with PHP extension, people cannot view the image using their image viewer.

Expected Result

Filename: dolphin.jpg

Actual result

Source code of redirect.php:

header('Location: dolphin.jpg');