BlueKai/bluekai_middleware — pull request #3 by jasonmp85 (2012-05-15 16:50:19+00:00)
Title: Add middleware to rewrite erroneous 200 statuses

Certain APIs always return a 200, instead putting the "real" semantic
status in a field of the response. This middleware assumes any JSON/XML
parsing has already occurred, after which time it looks for the status in
the response body (assuming the actual status was a 200). If the
"real" status is not 'QUERY_SUCCESS', the HTTP status is changed to a 400
to allow later middlewares to do the right thing. The approach is similar
to the MimeTypeFix class in the faraday_middleware gem.

cr: @jzhang-bk, @Nymbil