Class: Ably::Rest::Middleware::FailIfUnsupportedMimeType

Inherits:
Faraday::Response::Middleware
  • Object
show all
Defined in:
lib/submodules/ably-ruby/lib/ably/rest/middleware/fail_if_unsupported_mime_type.rb

Instance Method Summary collapse

Instance Method Details

#on_complete(env) ⇒ Object



8
9
10
11
12
13
# File 'lib/submodules/ably-ruby/lib/ably/rest/middleware/fail_if_unsupported_mime_type.rb', line 8

def on_complete(env)
  unless env.response_headers['Ably-Middleware-Parsed'] == true
    raise Ably::Exceptions::InvalidResponseBody,
          "Content Type #{env.response_headers['Content-Type']} is not supported by this client library"
  end
end