Applied additional check for mimetype

Check if mimetype is 'text/html' before applying the patch to the response
as proposed by @ogier.