Sha256: f6d028476f738161ce64dde0be4679f972a5dc157fa957b33887278efa21f7cd

Contents?: true

Size: 477 Bytes

Versions: 16

Compression:

Stored size: 477 Bytes

Contents

require 'faraday'
require 'json'

module Ably
  module Rest
    module Middleware
      class FailIfUnsupportedMimeType < Faraday::Response::Middleware
        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
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
ably-rest-0.8.2 lib/submodules/ably-ruby/lib/ably/rest/middleware/fail_if_unsupported_mime_type.rb
ably-0.8.2 lib/ably/rest/middleware/fail_if_unsupported_mime_type.rb
ably-0.8.1 lib/ably/rest/middleware/fail_if_unsupported_mime_type.rb
ably-rest-0.8.1 lib/submodules/ably-ruby/lib/ably/rest/middleware/fail_if_unsupported_mime_type.rb
ably-0.8.0 lib/ably/rest/middleware/fail_if_unsupported_mime_type.rb
ably-0.7.6 lib/ably/rest/middleware/fail_if_unsupported_mime_type.rb
ably-rest-0.7.5 lib/submodules/ably-ruby/lib/ably/rest/middleware/fail_if_unsupported_mime_type.rb
ably-0.7.5 lib/ably/rest/middleware/fail_if_unsupported_mime_type.rb
ably-0.7.4 lib/ably/rest/middleware/fail_if_unsupported_mime_type.rb
ably-rest-0.7.3 lib/submodules/ably-ruby/lib/ably/rest/middleware/fail_if_unsupported_mime_type.rb
ably-0.7.2 lib/ably/rest/middleware/fail_if_unsupported_mime_type.rb
ably-0.7.1 lib/ably/rest/middleware/fail_if_unsupported_mime_type.rb
ably-0.7.0 lib/ably/rest/middleware/fail_if_unsupported_mime_type.rb
ably-0.6.2 lib/ably/rest/middleware/fail_if_unsupported_mime_type.rb
ably-0.2.0 lib/ably/rest/middleware/fail_if_unsupported_mime_type.rb
ably-0.1.6 lib/ably/rest/middleware/fail_if_unsupported_mime_type.rb