http-request 1.1.10 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/http-request/response.rb +6 -1
- data/lib/http-request/version.rb +1 -1
- metadata +2 -2
@@ -16,7 +16,12 @@ module HttpRequest
|
|
16
16
|
content_encoding = @header['content-encoding'].to_s.downcase
|
17
17
|
if !content_encoding.empty? && (content_encoding.index('gzip') || content_encoding.index('deflate'))
|
18
18
|
gz = Zlib::GzipReader.new(StringIO.new(@body))
|
19
|
-
|
19
|
+
end
|
20
|
+
|
21
|
+
# Use encoding suggested by charset
|
22
|
+
charset = @header['content-type'].to_s.match(/charset=([a-z0-9-]*)/i).to_s
|
23
|
+
if !charset.empty?
|
24
|
+
@body.force_encoding(charset.split('=')[1]) rescue nil
|
20
25
|
end
|
21
26
|
end
|
22
27
|
|
data/lib/http-request/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: http-request
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -86,7 +86,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
86
86
|
version: '0'
|
87
87
|
segments:
|
88
88
|
- 0
|
89
|
-
hash:
|
89
|
+
hash: -1774260015767547978
|
90
90
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
91
91
|
none: false
|
92
92
|
requirements:
|