When mod_file serves a file, the mime-type should come
from the object's name's extension if needed.
This could be achieved in one of two ways:
1) mod_file does the work, using the name of the object to
extract an extension and then looking that up in the list of
mime types (as the wshare code does, in fact the code for
the mime type list is still around in mimetable.cxx)
2) FileMedia does the work, mapping the extension via a
table into a 'mime-type' member of each file object. This
would entail changing who FileMedia maps files: rather than
as simply into a ByteArray value, it would be an object with
members for each file system meta information (including
the synthetic mime-type), and a member 'contents' that
would be the ByteArray value.
Number two is more correct, but more work. (Perhaps this
should be two tasks...)
Logged In: YES
user_id=219202
Turns out mod_file already did this! All we needed to do was fix a
bug in its Path handling. This got fixed when Path was re-written
to deal with Empty paths and I reviewed all calls to Path() to see
if they should be Empty or Error or perhaps something else.
So, this task is now just the second way: Making FileMedia do the
work. This is clearly the "right way" to do it, but it will take more
work, and nothing requires it for now.