Render content-type text/html for json responses when application/json is not in HTTP_ACCEPT header

Some browsers won't send the application/json mime-type to HTTP_ACCEPT header when dealing with some tricks to enable Ajax file uploads:

It would be interesting if Rails could take care of it transparently by checking for the HTTP_ACCEPT header before rendering a JSON response with the 'application/json' content-type.

When 'application/json' is missing in the header the json content would be rendered as 'text/html' for better compatibility.

How does that sound like?