Error responses ignore accept header

Bug #1182155 reported by gholt
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
Won't Fix
Undecided
Azhagu Selvan SP

Bug Description

In swob.py it would seem the default response bodies are always wrapped in html boilerplate, no matter the request's accept header.

Revision history for this message
Gil Vernik (gilv) wrote :

@gholt; Before i start working on this one i want better understand what we want to achieve here. So if Accept: application / json than you expect swob to return an exception in JSON, like
{ 'title': 'xxx', 'description:'yyyy'}
?
All existing Swift customers and their various client tools currently expect HTML error and now they will receive JSON.
There is no doubt about the bug you reported, but still - do we really want to change existing API? i am a bit concern about it..
What do you think about?

Revision history for this message
John Leach (johnleach) wrote :

We've just hit this ourselves, recognised it as a bug and anticipated it may be fixed in future so our code expects json but handles html if it's given.

It seems this is a reasonable decision for someone developing a client, nicely in line with Postel's law. So can we assume all client developers did this and fix it in Swift? :)

Changed in swift:
status: New → Confirmed
Changed in swift:
assignee: nobody → pradeep kumar singh (pradeep-singh-u)
Changed in swift:
assignee: Pradeep Kumar Singh (pradeep-singh-u) → Azhagu Selvan SP (tamizhgeek)
Changed in swift:
status: Confirmed → In Progress
Revision history for this message
Azhagu Selvan SP (tamizhgeek) wrote :

I have the the first cut fix here:

https://review.openstack.org/#/c/204196/

Please comment.

Revision history for this message
clayg (clay-gerrard) wrote :

I sometimes notice something like this come up - making the errors and their bodies better - but I don't think anyone is seriously tracking it changing anytime soon.

Changed in swift:
status: In Progress → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.