Fixed a bug that caused last-modified header instructions to be followed incorrectly
Refactored duplication, return correct mimetype