rails/rails — pull request #8124 by adimichele (2012-11-06 00:03:09+00:00)
Title: "head" renders valid JSON if response type is "application/json"

I was getting javascript exceptions from jQuery using `$.post(...)` to an action that rendered using `head :ok` because head returns a blank response body (which is not valid JSON) even though $.post requested "application/json" and the response type was "application/json".

I went ahead and modified "head" put valid JSON in the response body if the response format is "application/json".

This may turn into a philosophical argument, but I would say that if the response claims that its content type is "application/json" that its body be valid for that type.