Markdown video detection is case sensitive and inconsistent with uploader file naming.
Summary
Videos uploaded via Safari on iOS (11.3.1) appear to be assigned an all-caps hexadecimal filename by Gitlab, with a file extension also in upper case. The markdown parser does not recognize the uppercase file extension and cannot properly display the embedded media player.
Changing the generated filename extension to lowercase causes the media player to appear, but causes a 404 for the actual video file.
Steps to reproduce
- Using iPhone with iOS 11+ create a brief screencast.
- Save screencast to photo library.
- Using Safari on the same phone, create a new issue or comment.
- Upload the screencast you just created to the issue/comment.
- Submit issue/comment.
- Attempt to view uploaded media.
Example Project
I will create a comment on this issue using the steps above to illustrate the problem.
What is the current bug behavior?
Video uploaded via gitlab.com iOS fails to render.
What is the expected correct behavior?
Uploaded media should render correctly in comments/issues (anywhere markdown is parsed).
Output of checks
This bug happens on GitLab.com
Possible fixes
-
Since it seems the gitlab.com filesystem (or the web server) is case sensitive, the easiest fix might be to include uppercase extensions in the list of accepted file extensions. Possibly located here: https://gitlab.com/gitlab-org/gitlab-ce/blob/master/app/uploaders/uploader_helper.rb#L36
This would resolve the issue for historical files that are already stored with an uppercase extensions.
-
You could make the uploaded file keep it's original filename, as it was stored with a lowercase filename on the iPhone originally. This doesn't help with historical files.
-
Convert all extensions to lowercase before storing. This doesn't help with historical files.