Posted by Jorrit on September 4, 2012 at 7:11am
7 followers
| Project: | Drupal core |
| Version: | 7.x-dev |
| Component: | file.module |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
| Issue tags: | 7.17 release notes, needs backport to D7 |
Issue Summary
The Content-Type header set by file_get_content_headers() adds a name attribute, that isn't standard or documented anywhere on the Internet. Although it doesn't cause any problems, leaving it in might confuse people (like me) when looking for bugs in their code.
I'll add a patch to remove it from Drupal 8. I'll be happy to port it to Drupal 7 and perhaps 6 if needed.
Comments
#1
The patch.
#2
I researched this yesterday and came up with the following conclusions in an e-mail to Jorrit:
TL;DR: We already fixed this in core once, but the FileField port into D7 reintroduced the problem. See http://drupal.org/node/103164.
#3
LOL that's awesome. Awesome find Jorrit, and awesome sleuthing too, quicksketch!
Committed and pushed to 8.x. We should fix this in 7.x, too.
#4
Here you go. Thanks for the quick commit!
#5
I'm not certain how to test this one since the bug isn't causing a problem for me with any browser that I've tried (using a private file field in FF, Chrome, and IE9). It's basically the same patch that got committed to D8 and the same fix that was introduced in #103164: Internet Explorer Not Opening Attachments Correctly-double window issue. The patch applied correctly and file downloads continued to work afterward. So I'm marking it RTBC. If anyone thinks this should be tested more thoroughly, go ahead and set the status back to "Needs review."
#6
Wow, with a history like that it is almost sad to remove it :) Like, it's been through so much, it doesn't deserve to die. Or maybe we are tempting fate, and it will be back again later, only this time more powerful than before...
Anyway, it seems to me like it's been tested and reviewed well enough, so I committed this to 7.x - thanks! http://drupalcode.org/project/drupal.git/commit/e218eff
As far as I can tell from reading the issue, there actually isn't anything to fix in Drupal 6 here, but feel free to reopen and backport if I'm wrong.
#7
Oh by the way, I did a little Googling and I got the impression that maybe this attribute once did exist, but was deprecated sometime in the early 1990's :)
http://www.imc.org/ietf-822/old-archive2/msg02121.html
Though I wasn't 100% sure that was referring to the same thing.
#8
Automatically closed -- issue fixed for 2 weeks with no activity.
#9
Although this is a pretty trivial change, it did break a core test, so on second thought I'm adding this to the release notes and CHANGELOG.txt just in case someone is relying on it somewhere.