"application/json" instead of "text/json"
Bug #843226 reported by
Dolph Mathews
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Identity (keystone) |
Fix Released
|
Medium
|
Yogeshwar |
Bug Description
There are a few places in Keystone middleware pieces (token_auth.py, etc), where the "Accept": "text/json" should be "Accept": "application/json". -Liem Nguyen
Changed in keystone: | |
status: | New → Confirmed |
Changed in keystone: | |
status: | Confirmed → Fix Committed |
Changed in keystone: | |
importance: | Undecided → Medium |
Changed in keystone: | |
milestone: | none → essex-1 |
Changed in keystone: | |
assignee: | nobody → Yogeshwar (yogesh-srikrishnan) |
Changed in keystone: | |
status: | Fix Committed → Fix Released |
Changed in keystone: | |
milestone: | essex-1 → 2012.1 |
To post a comment you must log in.
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 response( req):
def is_xml_
"""Returns True when the request wants an XML response, False otherwise"""
return "Accept" in req.headers and "application/xml" in req.accept
if result: response( req):
resp. headers[ 'content- type'] = "application/xml"
resp. headers[ 'content- type'] = "application/json"
if is_xml_
content = result.to_xml()
else:
content = result.to_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.