Skip to content

Fix ResoFaradayMiddleware NoMethodError on XML responses

Choose a tag to compare

@atomfbs atomfbs released this 08 May 16:57
fd881c6

Rescue in ResoFaradayMiddleware#on_complete referenced the local
body variable, but MultiJson.decode raised before body was
assigned — leaving it nil. .strip on nil raised NoMethodError
for every non-JSON response, including legitimate RESO XML metadata
(/Reso/OData/$metadata).
Reference env[:body] (the raw body) instead.
Adds spec coverage: legacy D-envelope passthrough, flat OData JSON,
XML metadata regression, and genuine non-JSON/non-XML still raising
MultiJson::ParseError.