http basic auth failures respect request.accept for json/xml #6394

Closed
wants to merge 2 commits into from
Commits on May 19, 2012
  1. @darragh

    Extract out common method for rendering a 401 Access Denied response.

    darragh committed May 18, 2012
    Looks after setting the WWW-Authenticate header, the status code and the response body.
  2. @darragh

    http basic auth 401 body encoded as json or xml when requested

    darragh committed May 19, 2012
    We got reports of problems caused by our rails app returning text/html content to api requests with an accept header of application/json. This change alters the http basic auth failure response to match the request accept format when xml or json