Connect middleware to modify the Accept header based on the extension