(refactor) simplified content_type retrieval

This commit changes the content_type retrieval
to use the built in method `extension_str()` instead
of the hand crafted Regex to figure out the
content_type.

It also adds a test.