octokit 6.0.0 → 6.0.1

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: c3018cabf6ab75fe3a4340d20a4844ab92fa7059a4bbbdd96b9b671537aef5b5
4
- data.tar.gz: 6308252f312bb301eadfe573daf9d5e17ce0698480dbdc938f72b62831e73632
3
+ metadata.gz: 3ac7553d8be06123cac2720aa58ad0025845326916a3203f90b8713a6dbb3752
4
+ data.tar.gz: 3b0e9e958e9d4014cf9f95609ab078af9466613dc808d63f2a0cd3a666c063d2
5
5
  SHA512:
6
- metadata.gz: 7477cd6b438fedbec3fe952a8aebeefa224b991a65c8950c26c938db69962614d1ae066c3afd4b40a37ab935637af2dbc08ae126f8e5d199c16df1e646b2878b
7
- data.tar.gz: 6d891d836aa8118c9cce64d265ee26d8e97f7dc05425d491d0d7123f1b9fab12eb3aa62ccc85a1b69640ed29819dba7b19d34161f2fa5b159a0b36701c0c758a
6
+ metadata.gz: 5e0ffef0af68dc1270dc8f1af6cb841532b295dce58aa46cf8e6969f02d4ec1ab117a1198e136350bb630fb6d6120b4231a5d635214b693c997e0b990397258a
7
+ data.tar.gz: 269e9d3a3fcdb270dfa274d4225a8fa7f2de23280eae137aca3b82a1355f305dcc0fa93c23333a48760004503d9c4336231c588ee8135f1f7ce1434c1a180166
@@ -154,7 +154,7 @@ module Octokit
154
154
  end
155
155
 
156
156
  @last_response = response = agent.call(method, Addressable::URI.parse(path.to_s).normalize.to_s, data, options)
157
- response.data
157
+ response_data_correctly_encoded(response)
158
158
  rescue Octokit::Error => e
159
159
  @last_response = nil
160
160
  raise e
@@ -206,5 +206,13 @@ module Octokit
206
206
 
207
207
  opts
208
208
  end
209
+
210
+ def response_data_correctly_encoded(response)
211
+ content_type = response.headers.fetch('content-type', '')
212
+ return response.data unless content_type.include?('charset') && response.data.is_a?(String)
213
+
214
+ reported_encoding = content_type.match(/charset=([^ ]+)/)[1]
215
+ response.data.force_encoding(reported_encoding)
216
+ end
209
217
  end
210
218
  end
data/lib/octokit/error.rb CHANGED
@@ -77,7 +77,7 @@ module Octokit
77
77
  Octokit::TooManyRequests
78
78
  when /login attempts exceeded/i
79
79
  Octokit::TooManyLoginAttempts
80
- when /(returns|for) blobs (up to|between) [0-9\-]+ MB/i
80
+ when /(returns|for) blobs (up to|between) [0-9-]+ MB/i
81
81
  Octokit::TooLargeContent
82
82
  when /abuse/i
83
83
  Octokit::AbuseDetected
@@ -11,7 +11,7 @@ module Octokit
11
11
 
12
12
  # Current patch level.
13
13
  # @return [Integer]
14
- PATCH = 0
14
+ PATCH = 1
15
15
 
16
16
  # Full release version.
17
17
  # @return [String]
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: octokit
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.0
4
+ version: 6.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wynn Netherland
8
8
  - Erik Michaels-Ober
9
9
  - Clint Shryock
10
- autorequire:
10
+ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2022-10-20 00:00:00.000000000 Z
13
+ date: 2022-11-23 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler
@@ -168,7 +168,7 @@ licenses:
168
168
  - MIT
169
169
  metadata:
170
170
  rubygems_mfa_required: 'true'
171
- post_install_message:
171
+ post_install_message:
172
172
  rdoc_options: []
173
173
  require_paths:
174
174
  - lib
@@ -183,8 +183,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
183
183
  - !ruby/object:Gem::Version
184
184
  version: 1.3.5
185
185
  requirements: []
186
- rubygems_version: 3.1.6
187
- signing_key:
186
+ rubygems_version: 3.1.2
187
+ signing_key:
188
188
  specification_version: 4
189
189
  summary: Ruby toolkit for working with the GitHub API
190
190
  test_files: []