Use mediaType request attribute
Move regex into configuration