uc3-dmp-external-api 0.0.14 → 0.0.16

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: db272af293487c9f22cfa9077303a902e0f62f826797966c58ac3cb65f281b02
4
- data.tar.gz: 9663f7139db0c7ff5f47b9101676d8edc787d7021f8118deba245233d074da66
3
+ metadata.gz: d8e39973a3b40b3db04e6c29f794882480c708a2a87d40b224bdaa1d0d77e196
4
+ data.tar.gz: c6e41bb28b599435ff4181a2ddbddaad688c3cd02d2c3e20bb824c43bdf4050e
5
5
  SHA512:
6
- metadata.gz: 24c8e3df1132946e87ed17c95900b2009d52ac89923a2d719ff6937947a2f276fab4f0d08701a0ae85ef5ca62dbc3d8fc1d1525520f6cc73c6b0b27da7d4fade
7
- data.tar.gz: e35e9fbf8a97edeccb3d2403fa511c75d52d3ba905a801ed46cfd13dcc2ab1f3c40a4e045262bc64c6615732341854c13560053a27669c21962e19bce328aaec
6
+ metadata.gz: ddce47c28c5d53a8534f2a81bbb677ed2010ae8b9cd893ce3e10f61d26818a25aee7f3be22866f0d0fe2be30d01e3218b9094dba47c744c92a9732909a8695a4
7
+ data.tar.gz: 2e12614a7d6e0511be963ad169203e458a15b6a3fcb32c92c054db5001f6b84658a42335ed7f96684dd887d29c4bf8050e61382b7c86435ff431b0f09f6c14e4
@@ -25,7 +25,7 @@ module Uc3DmpExternalApi
25
25
  opts = _options(body: body, basic_auth: basic_auth, additional_headers: additional_headers, logger: logger)
26
26
  resp = HTTParty.send(method.to_sym, uri, opts)
27
27
 
28
- if resp.code != 200
28
+ if ![200, 201].include?(resp.code)
29
29
  msg = "status: #{resp&.code}, body: #{resp&.body}"
30
30
  raise ExternalApiError, "#{format(MSG_ERROR_FROM_EXTERNAL_API, url: url)} - #{msg}"
31
31
  end
@@ -69,7 +69,7 @@ module Uc3DmpExternalApi
69
69
  follow_redirects: true,
70
70
  limit: 6
71
71
  }
72
- opts[:basic_auth] = basic_auth if basic_auth.is_a?(Hash)
72
+ opts[:basic_auth] = basic_auth if basic_auth.is_a?(Hash) && basic_auth.keys.any?
73
73
  # If the body is not already JSON and we intend to send JSON, convert it
74
74
  opts[:body] = body.is_a?(Hash) && hdrs['Content-Type'] == 'application/json' ? body.to_json : body
75
75
  # If debug is enabled then tap into the HTTParty gem's debug option
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Uc3DmpExternalApi
4
- VERSION = '0.0.14'
4
+ VERSION = '0.0.16'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uc3-dmp-external-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.14
4
+ version: 0.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Riley
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-10 00:00:00.000000000 Z
11
+ date: 2023-08-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-sns