kudzu 1.1.7 → 1.1.8

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: adc0bdb2f1017f8f4e8abcc2f0e6416c88b2110ce9f345957c6233484505509c
4
- data.tar.gz: 49a6c3166b4d499177a144987623d17e516c4a6d84674af81d883dddbfee3b5b
3
+ metadata.gz: c800ecf84774efe264d7ab653c2c138aa9b2110e04c96f33b917b5b5e86d211b
4
+ data.tar.gz: 6b8c36b2b012308b7cfa2a7b50029c8261e15ed983dd2c61e16ea85095a040dc
5
5
  SHA512:
6
- metadata.gz: 7eba18403646beab304d92b9826bb774f4d2b2f59b365402b2aeadb3ae5e05a50f0604a5c8ba7ccfe63176db82ea85bf7759697b1069adda860a8c2e4ef56bff
7
- data.tar.gz: 456b279651849f18308de4ab93cf76e4644988fdbb5ac023fa32b6d5cc163298236e374c8323227d2540854f4579d08e137caf844bf49c41235dd5a112b9dc6f
6
+ metadata.gz: '0998ed3c26fa729e4fc473c4ed98acbaa6862e23d1a7b0feb341322f7fcd50cb38b8fa9759c54e38909214fb6f349da21a11742e24324b53d5dcfd92a9f0f239'
7
+ data.tar.gz: 7bf7bd66e00c3cf63d83716517bac1d33ca975827a6eb610e9eaac034464339f1738c3a92b07ce69bbf541dc999bcb814675e1c2510bdbaa5e09f83aa2460ba8
@@ -83,12 +83,18 @@ module Kudzu
83
83
  Response.new(url: url,
84
84
  status: response.code.to_i,
85
85
  body: fetched ? response.body.to_s : nil,
86
- response_header: Hash[response.each.to_a],
86
+ response_header: force_header_encoding(Hash[response.each.to_a]),
87
87
  response_time: response_time,
88
88
  redirect_from: redirect_from,
89
89
  fetched: fetched)
90
90
  end
91
91
 
92
+ def force_header_encoding(response_header)
93
+ response_header.each do |key, value|
94
+ response_header[key] = value.force_encoding('utf-8').encode('utf-8', invalid: :replace, undef: :replace)
95
+ end
96
+ end
97
+
92
98
  def redirection?(code)
93
99
  code = code.to_i
94
100
  300 <= code && code <= 399
data/lib/kudzu/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Kudzu
2
- VERSION = '1.1.7'
2
+ VERSION = '1.1.8'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kudzu
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.7
4
+ version: 1.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yoshikazu Kaneta
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-08 00:00:00.000000000 Z
11
+ date: 2018-08-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable