JSON responses through a proxy

Hello, I submitted a patch a while ago as ticket 2701 which has not been applied to the mainline. I was wondering if someone could vet that and get it in. Currently AJAX queries fail on my installation since it goes through a proxy that modifies any HTML that comes through. The patch changes the MIME Content-type to application/json which is what it should be.

I’ll asked greg to take a look at it. Seems ok to me but he has a much better understanding of the code.