? Success
Pull Request for # 9470

User tests: Successful: Unsuccessful:

avatar andrepereiradasilva
andrepereiradasilva
18 Mar 2016

Pull Request for Issue #9470

Summary of Changes

Add text mimetype for system information text download.

Testing Instructions

Download system information in text, and check if in http header the content type is text/plain

avatar andrepereiradasilva andrepereiradasilva - open - 18 Mar 2016
avatar andrepereiradasilva andrepereiradasilva - change - 18 Mar 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 18 Mar 2016
Labels Added: ?
1382266 18 Mar 2016 avatar andrepereiradasilva ups
avatar brianteeman brianteeman - change - 18 Mar 2016
Rel_Number 0 9470
Relation Type Pull Request for
avatar andrepereiradasilva andrepereiradasilva - change - 18 Mar 2016
The description was changed
avatar mbabker
mbabker - comment - 18 Mar 2016

I've tried that and I still got the wrong MIME.

avatar mbabker
mbabker - comment - 18 Mar 2016

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
avatar andrepereiradasilva
andrepereiradasilva - comment - 18 Mar 2016
# 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
avatar mbabker
mbabker - comment - 18 Mar 2016

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
avatar andrepereiradasilva
andrepereiradasilva - comment - 18 Mar 2016

did you download the file directly in linux, or in windows and them copied to linux (i did this second option)

avatar mbabker
mbabker - comment - 18 Mar 2016

Everything's directly off my MacBook. I haven't had a Windows dev environment for years, and I kinda like it that way :smiley:

avatar andrepereiradasilva
andrepereiradasilva - comment - 18 Mar 2016

why exactly we need the mime-type to be right in *nix?

avatar mbabker
mbabker - comment - 18 Mar 2016

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.

avatar andrepereiradasilva
andrepereiradasilva - comment - 19 Mar 2016

IMHO this PR adds the content-type as it should.
The tracker problems are another issue.

avatar mbabker
mbabker - comment - 19 Mar 2016

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).

avatar wilsonge wilsonge - change - 20 Mar 2016
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2016-03-20 17:00:44
Closed_By wilsonge
avatar wilsonge wilsonge - close - 20 Mar 2016
avatar wilsonge wilsonge - merge - 20 Mar 2016
avatar wilsonge wilsonge - reference | dba169d - 20 Mar 16
avatar wilsonge wilsonge - merge - 20 Mar 2016
avatar wilsonge wilsonge - close - 20 Mar 2016
avatar wilsonge wilsonge - change - 20 Mar 2016
Milestone Added:
avatar andrepereiradasilva andrepereiradasilva - head_ref_deleted - 20 Mar 2016
avatar Fedik
Fedik - comment - 22 Mar 2016

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

Add a Comment

Login with GitHub to post a comment