uc3-dmp-external-api 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ea45bcd655de003ed7755e1448102045ed5d31615c9fb527fa02ef8e1e9d6912
4
- data.tar.gz: f21f46a94719d54e1654e7d12cfcbf09b42fdaf8f3b0ccf3d1bf2780f3a47f80
3
+ metadata.gz: b41876f49ab45317250eb4aeaca2ecb9635d4cd206760b30305dc1281d90617e
4
+ data.tar.gz: 220165091dccd3294ee320c44b5f20e7b61e440d40074bb33fd46bf4516f3461
5
5
  SHA512:
6
- metadata.gz: 804960d9db2f1e20051ec8c7e0a0b0ba4f80f02e99ce85033eb67417988a2af5480f6687966368f059c98f9bc357f5f78aa545b260f671799e8276518bd464fb
7
- data.tar.gz: 4a8aee1b9e08ca14893232798032cbd9cd2a0b180bc7a9a650765af356becc4eaaa9451ef40e34083aa91fe95bf4678828326e40c29eadb822be62374f8bbee7
6
+ metadata.gz: d2cfa86ab698360557df42c9a64b5d52049c3e46d3d4385b6b43fcfe8e50587a86a492d3462a50459c38741a2fa1e9eaaa3b81955768a1e6f6bdad223d88731b
7
+ data.tar.gz: 8efe0a48af02913ff05b70a8f618db5a2e340d5ec06acddcbab3980ab71e14f8d4c5e2bf723ff236960975f8e9f23757b5f47b14a9094780a4676bf9d0b38fbb
@@ -45,7 +45,12 @@ module Uc3DmpExternalApi
45
45
  def _process_response(resp:)
46
46
  return nil if resp.body.nil? || resp.body.empty?
47
47
 
48
- case resp.headers.fetch('content-type', '')
48
+ puts "HEADER: #{resp.headers['content-type']}"
49
+
50
+ mime = resp.headers['content-type']
51
+ mime = 'application/json' if mime_type.nil? && (rep.body.start_with?('[') || resp.body.start_with?('{'))
52
+
53
+ case mime
49
54
  when 'application/json'
50
55
  JSON.parse(resp.body)
51
56
  else
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Uc3DmpExternalApi
4
- VERSION = '0.0.4'
4
+ VERSION = '0.0.5'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uc3-dmp-external-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Riley