Improve support for content-types.

Change-Id: Iaa1c9d6ad35cf8feec77d61e98045fbc03e75bab