gitlabhq/gitlabhq — pull request #7982 by Soullivaneuh (2014-10-07 12:19:06+00:00)
Title: Fix and improve help rendering

In latest versions of Gitlab, image rendering on wiki is broken because not public and not handled by controllers.

I simplified help controller in order to handle each .md and .other files.

In a nutshell:
* Add .md file on mime_types initializers to recognize as html
* Change help_show route to be more generic (subpath in all level possible)
* New controller logic:
* Get the requested filepath (without extension) and the format
* If `md` format, call `render_doc` (Same logic as the old one).
* if another format (`all`), call `send_file_data` which test if file exists and just send the content with inline attachment.

With this system, all another file (jpg, png, svg, what else ?) can be handled by help controller and image are no more broken.

I think `send_file` response can be improved (cache or another header), do you have some suggestions about it ?

Thanks.