Fixed bug when mimetype cannot be guessed

Response mimetype is set to text/plain when it cannot be guessed from the extension.