Comment 1 for bug 843226

Revision history for this message
Yogeshwar (yogesh-srikrishnan) wrote :

Looks like there is a new quatum_auth_token.py which uses incorrect behavior and is been found and fixed by Dolph.

This is how our code looks
def is_xml_response(req):
    """Returns True when the request wants an XML response, False otherwise"""
    return "Accept" in req.headers and "application/xml" in req.accept

if result:
        if is_xml_response(req):
            content = result.to_xml()
            resp.headers['content-type'] = "application/xml"
        else:
            content = result.to_json()
            resp.headers['content-type'] = "application/json"

So any content type other than application/xml was treated as application/json and the bug never caused issues as we defauted to json for incorrect accepts.