you can also detect content-type via mime if this was to be used elsewhere, but no big deal here.