API responds with incorrect Content-Type on HTTP errors
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Solum |
Triaged
|
Medium
|
Gilbert Pilz |
Bug Description
Solum resources that are exposed with "@pecan.expose" (not sure about those exposed by "@wsme_
The reason for this is that our common exception handling code (enabled by "@exception.
1.) https:/
2.) https:/
Changed in solum: | |
assignee: | nobody → Gilbert Pilz (gilbert.pilz) |
Changed in solum: | |
importance: | Undecided → Medium |
status: | New → Triaged |
I checked and controllers that are exposed by "@wsme_ pecan.expose( )" do not have this problem. The exception handling logic in " @exception. wrap_wsme_ controller_ exception" format the message body resulting from an exception in JSON with a Content-Type of "application/json".
This, however, brings up another issue. Right now, if you use the Solum API, most methods of most resources will return a JSON body with any HTTP error but *some* methods of *some* resources will return a plain text message body. This seems less than ideal. We are requiring well-written clients to be aware of this behavior. It would be better if *all* methods of *all* resources either returned plain text error messages or JSON error messages.