api_hammer 0.18.1 → 0.18.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: e91b96d24872a1d8bed529e435ee220fedc2f90e
4
- data.tar.gz: 79efc1dc82362fa52906e83314b1ce10e0a2872f
2
+ SHA256:
3
+ metadata.gz: d08b690f386355cb74fcf2f6dea70a70db2a84baa95087b77a3ef3b7e13b146f
4
+ data.tar.gz: a483f9f0b8ca038f76623a1014bbdcf4a37d266293f26976bf439ecba1ae17e2
5
5
  SHA512:
6
- metadata.gz: 465349874c9e57aa860d70de8bee3386b4497bbc06adae9242e6b9ee16afd629f424a76d5b5693ac11a484ee82993ec7b619cf85cd4550be8562c1e9ada0ec64
7
- data.tar.gz: ca74a38d500888996b05a558815f9d0b59217dd46dc12195467c911db9bc869e1ff9d514036a302264694d4465095cda8faabae368a9c37d9551dacbf0d79031
6
+ metadata.gz: 2b3a55ad37ca4ca755c8de88c09a1c713b654d3cde3e51fa63d37e04c236582f02da336b4882dd9f18cc3e5ff078464c9cc569e1a18933c03e7eb0fd2d8c3d0b
7
+ data.tar.gz: 3f4c29c95bba19accd4a74ce940d9fdc967e27634bc2c60587806387502e727b908c6ce03218d78687a86348a5058a0e2ebd58b2b39430726c8747b1cc8f7302
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # v0.18.2
2
+ - bugfix utf8 http body handling
3
+ - report to Rollbar on 4xx if Rollbar available and DEBUG_4XX indicates so
4
+
1
5
  # v0.18.1
2
6
  - improve supported media types for sinatra
3
7
  - report to Rollbar on 4xx if Rollbar available
@@ -86,7 +86,7 @@ module ApiHammer
86
86
  # if updating by content-type didn't do it, try UTF8 since JSON wants that - but only
87
87
  # if it seems to be valid utf8.
88
88
  # don't try utf8 if the response content-type indicated something else.
89
- try_utf8 = !(content_type_attrs && content_type_attrs.parsed? && content_type_attrs['charset'].any?)
89
+ try_utf8 = !(content_type_attrs && content_type_attrs.parsed? && content_type_attrs['charset'].any? { |cs| !['utf8', ''].include?(cs.downcase) })
90
90
  if try_utf8 && body.dup.force_encoding('UTF-8').valid_encoding?
91
91
  body.force_encoding('UTF-8')
92
92
  else
@@ -31,7 +31,7 @@ module ApiHammer
31
31
  end
32
32
  end
33
33
  body['error_message'] = error_message if error_message
34
- if Object.const_defined?(:Rollbar) and status != 404
34
+ if Object.const_defined?(:Rollbar) and status != 404 and Object.const_defined?(:DEBUG_4XX) and DEBUG_4XX['enabled']
35
35
  Rollbar.debug "Service halted with status #{status}", status: status, body: body, halt_options: halt_options
36
36
  end
37
37
  halt(status, body, halt_options)
@@ -1,3 +1,3 @@
1
1
  module ApiHammer
2
- VERSION = "0.18.1"
2
+ VERSION = "0.18.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: api_hammer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.18.1
4
+ version: 0.18.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ethan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-09-11 00:00:00.000000000 Z
11
+ date: 2018-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -305,7 +305,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
305
305
  version: '0'
306
306
  requirements: []
307
307
  rubyforge_project:
308
- rubygems_version: 2.6.11
308
+ rubygems_version: 2.7.7
309
309
  signing_key:
310
310
  specification_version: 4
311
311
  summary: an API tool