Click on link to *.qcow2 file display raw content inside the web browser
If you click on a link to a
qcow2 file on openqa.opensuse.org, it displays the raw content inside the web browser instead of starting a proper file download.
- Status changed from New to Feedback
- Assignee set to okurz
I created https://github.com/os-autoinst/openQA/pull/3273 which ensures by test the content type of assets and such. However the test shows that 'application/octet-stream' is returned correctly already.
Checking directly on osd I can find:
okurz@openqa:~> curl --verbose http://localhost:9526/assets/hdd/SLES-12-SP2-x86_64-mru-install-minimal-with-addons-Build20180904-3.qcow2 2>&1 | grep -i 'content-type' < Content-Type: application/octet-stream okurz@openqa:~> curl --verbose http://localhost/assets/hdd/SLES-12-SP2-x86_64-mru-install-minimal-with-addons-Build20180904-3.qcow2 2>&1 | grep -i 'content-type'
So the file is served correctly by mojolicious but not anymore over the apache proxy.
Adding an explicit type in the apache config following https://httpd.apache.org/docs/2.4/mod/mod_mime.html#addtype works. I have done that for testing on openQA using apache and added a commit to https://github.com/os-autoinst/openQA/pull/3273
- Status changed from Feedback to Resolved
merged and deployed. On the latest create_hdd_textmode I checked all logs, results and assets and can confirm that video, vars.json and *.txt open directly in a browser with no special configuration whereas *.tar.bz2, *.iso, *.virtualbox.box, *.sha256 and in particular *.qcow2 are offered for download.