Fix and improve help rendering
Created by: soullivaneuh
In latest versions of Gitlab, image rendering on wiki is broken because not public and not handled by controllers.
Referred issues:
- #6758
- #7539
- #7610
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, callrender_doc
(Same logic as the old one). - if another format (
all
), callsend_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.