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.
@@ -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
- @body = gz.read
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
 
@@ -1,3 +1,3 @@
1
1
  module HttpRequest
2
- VERSION = '1.1.10'
2
+ VERSION = '1.2.0'
3
3
  end
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.1.10
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: 4173997443445813792
89
+ hash: -1774260015767547978
90
90
  required_rubygems_version: !ruby/object:Gem::Requirement
91
91
  none: false
92
92
  requirements: