Bug 1121741
Summary: | Attachment format detection is often wonky | ||
---|---|---|---|
Product: | [Community] Bugzilla | Reporter: | Adam Williamson <awilliam> |
Component: | Attachments/Requests | Assignee: | Matt Tyson 🤬 <mtyson> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | tools-bugs <tools-bugs> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 4.4 | CC: | awilliam, bugzilla, jmcdonal, mtyson, rjoost, szhou |
Target Milestone: | 4.4 | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: | |||
Fixed In Version: | 4.4.5024 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2014-08-27 00:28:22 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Adam Williamson
2014-07-21 18:36:59 UTC
I've noticed this a few times too. I'd be a bit surprised if Red Hat Bugzilla is deviating from the upstream implementation of that feature, but I'll dig into the code and try to make some recommendations for improving it. After further investigation, I've concluded that Bugzilla is guessing the mime types of each attachment based on the file extension rather than the content. I reached this conclusion after submitting the same icon file six times with different filename extensions to a test instance of Bugzilla. Here's what it did: favicon.ico image/vnd.microsoft.icon favicon.diff patch favicon.jpg image/jpeg favicon.log text/x-log favicon.txt text/plain favicon application/octet-stream thanks for the testing! obviously content based detection would be the best, but a quick bodge that'd help a lot of cases would simply be to make the type for the .log extension be text/plain not text/x-log . i think that's the one that causes the most heartache. > I reached this conclusion after submitting the same icon file six times with
> different filename extensions to a test instance of Bugzilla.
Bugzilla only performs auto detection of the mime type if the uploaded file has a content type of application/octet-stream.
If the browser uploads a file with supplied content type of text/x-log then bugzilla won't perform any mime type auto detection.
We'll try widening the scope of what we auto detect. This seems to file most text looking files under text/plain.
do you know what causes the supplied content type to be text/x-log? is it something Firefox does when submitting a file with the extension .log, perhaps? (In reply to Adam Williamson (Red Hat) from comment #6) > do you know what causes the supplied content type to be text/x-log? is it > something Firefox does when submitting a file with the extension .log, > perhaps? Yes, the browser is supping the mime type when the file is uploaded. awesome, thanks very much! so this change will wind up in the staging BZ, right? I'll try and remember to test it out there. This change is now live. If there are any issues, do not reopen this bug. Instead, you should create a new bug and reference this bug. (clearing needinfo) I'm happy with the status here; I will file any follow-up issues that arise separately. |