muffinista/gopher2000 — pull request #2 by alexander255 (2014-03-08 16:22:46+00:00)
Title: Added MIME based content type detection

This patch adds automated MIME type detection for all files types using MimeMagic GEM.

These mechanism are tried to detect the file type:
* MIME type detection based on file extension
* MIME type detection based on file content signatures (the "magic" part of MimeMagic)
* Detection of plain text vs binary file by looking for NUL bytes in the first 1k of the file's contents

This patch also fixes a bug where the files for the listing where collected using a "*.*" glob pattern which ignored filenames which don't contain a dot.