Class | FaradayMiddleware::ParseJson::MimeTypeFix |
In: |
lib/faraday_middleware/response/parse_json.rb
|
Parent: | ResponseMiddleware |
Public: Override the content-type of the response with "application/json" if the response body looks like it might be JSON, i.e. starts with an open bracket.
This is to fix responses from certain API providers that insist on serving JSON with wrong MIME-types such as "text/javascript".
MIME_TYPE | = | 'application/json'.freeze |
BRACKETS | = | %w- [ { - |