User tests: Successful: Unsuccessful:
Pull Request for Issue #9470
Add text mimetype for system information text download.
Download system information in text, and check if in http header the content type is text/plain
Status | New | ⇒ | Pending |
Labels |
Added:
?
|
Rel_Number | 0 | ⇒ | 9470 |
Relation Type | ⇒ | Pull Request for |
If you're on a *nix
box, run this on the file you get:
file --mime /path/to/systeminfo-<date>.txt
/Users/mbabker/Downloads/systeminfo-2016-03-18T12-15-46-04-00.txt: text/x-c++; charset=us-ascii
# file --mime systeminfo-2016-03-18T22-20-54+00-00.txt
systeminfo-2016-03-18T22-20-54+00-00.txt: text/x-c++; charset=utf-8
note my charset is utf-8, must be something related to *nix systems
check this
# file --mime /path/to/joomla/htaccess.txt
htaccess.txt: text/html; charset=us-ascii
Just for giggles:
Michaels-MacBook-Pro:joomla-cms mbabker$ file --mime htaccess.txt
htaccess.txt: text/html; charset=us-ascii
Michaels-MacBook-Pro:joomla-cms mbabker$ file --mime README.txt
README.txt: text/plain; charset=us-ascii
Michaels-MacBook-Pro:joomla-cms mbabker$ file --mime LICENSE.txt
LICENSE.txt: text/plain; charset=us-ascii
Michaels-MacBook-Pro:joomla-cms mbabker$ file --mime robots.txt.dist
robots.txt.dist: text/plain; charset=us-ascii
Michaels-MacBook-Pro:joomla-cms mbabker$ file --mime web.config.txt
web.config.txt: application/xml; charset=us-ascii
did you download the file directly in linux, or in windows and them copied to linux (i did this second option)
Everything's directly off my MacBook. I haven't had a Windows dev environment for years, and I kinda like it that way
why exactly we need the mime-type to be right in *nix?
Well part of it is the issue tracker validates MIME types on uploads and right now it looks like the .txt file with the system info downloads with a MIME that isn't the "normal" one for .txt files so the issue tracker blocks its upload dependent on the underlying PHP configuration, see joomla/jissues#760. So if we can't get it right from here, we gotta do something in the tracker application code.
IMHO this PR adds the content-type as it should.
The tracker problems are another issue.
In theory you're right. As I commented at the beginning, I tried this exact same change locally before filing the issue and I still ended up with a "wrong" configuration. So I don't know if something's magically being converted in transit by the browser or if there's a PHP environmental thing involved, but as much as that should be the only change required for whatever reason it isn't working right (I'd still say merge this).
Status | Pending | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-03-20 17:00:44 |
Closed_By | ⇒ | wilsonge |
Milestone |
Added: |
for note:
file --mime
tries to guess the file type by it's content, header Content-Type: text/plain;
only for browser.
I tried make some test and if you remove whole Folder Permissions
section then the file will be detected as text/plain
I've tried that and I still got the wrong MIME.