api_hammer 0.4.2 → 0.4.3

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
2
  SHA1:
3
- metadata.gz: c2f9e2e65c6bd39813bce85257d2ff06f3a9296c
4
- data.tar.gz: dd5ba2a6902c635d761edf351399820ace975bfc
3
+ metadata.gz: 2249d364c2e8a31b69f9e98e284ec2160b2a58ef
4
+ data.tar.gz: 1feb8ef43dc7d861f4aa581924a6e217b074abf4
5
5
  SHA512:
6
- metadata.gz: 22059c86a14b39b299ca220fe0465ebcd0fd2d220832a3c49152f02c82b40aca902032c9fd1649cb2052046ac8836e234d7052dd454211feb4d6249fbedbcd57
7
- data.tar.gz: 907c407c523d113eb6ceb0c21bcb32357dd4bb26c71fd08d3b27e8d0dd721473f4d1a6bf62d87e216e1c504f850a82f3c81e441b23486652cfe07697f365f520
6
+ metadata.gz: 1842347f2fab562854fb809a7f73dd601cea6cca5cf02ab2f4cc02e2440eb168ac1d85fe65478b9c01af8f6b6f6acfb162ba5d105afcaf779bcd5d5f18c56bf7
7
+ data.tar.gz: 1affa946256f016d0e86ada2948f85474e94b93bf8e74944abc71b246aaac88b33118dce62dbf588b1b179d5da42802d5021590bab3b93397cb3684019e03dc0
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ # 0.4.3
2
+ - bugfix
3
+
1
4
  # 0.4.2
2
5
  - bugfix encoding in faraday request logger
3
6
 
@@ -63,7 +63,7 @@ module ApiHammer
63
63
  end
64
64
  if parsed
65
65
  charset = attributes['charset'].first
66
- if Encoding.list.any? { |enc| enc.to_s.downcase == charset.downcase }
66
+ if charset && Encoding.list.any? { |enc| enc.to_s.downcase == charset.downcase }
67
67
  if response_body.dup.force_encoding(charset).valid_encoding?
68
68
  response_body.force_encoding(charset)
69
69
  else
@@ -1,3 +1,3 @@
1
1
  module ApiHammer
2
- VERSION = "0.4.2"
2
+ VERSION = "0.4.3"
3
3
  end
@@ -57,7 +57,19 @@ describe ApiHammer::RequestLogger do
57
57
  assert_match(/Jalapeños/, logio.string)
58
58
  end
59
59
 
60
- it 'deals with encoding not specified by the content type' do
60
+ it 'deals content type specifying no encoding' do
61
+ app = proc do |env|
62
+ [200, {'Content-Type' => 'text/plain; x=y'}, ["Jalapeños".force_encoding("ASCII-8BIT")]]
63
+ end
64
+ conn = Faraday.new do |f|
65
+ f.request :api_hammer_request_logger, logger
66
+ f.use Faraday::Adapter::Rack, app
67
+ end
68
+ conn.get '/'
69
+ assert_match(/Jalapeños/, logio.string)
70
+ end
71
+
72
+ it 'deals with no content type' do
61
73
  app = proc do |env|
62
74
  [200, {}, ["Jalapeños".force_encoding("ASCII-8BIT")]]
63
75
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: api_hammer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ethan