octokit 6.0.0 → 6.0.1
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 +4 -4
- data/lib/octokit/connection.rb +9 -1
- data/lib/octokit/error.rb +1 -1
- data/lib/octokit/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ac7553d8be06123cac2720aa58ad0025845326916a3203f90b8713a6dbb3752
|
4
|
+
data.tar.gz: 3b0e9e958e9d4014cf9f95609ab078af9466613dc808d63f2a0cd3a666c063d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e0ffef0af68dc1270dc8f1af6cb841532b295dce58aa46cf8e6969f02d4ec1ab117a1198e136350bb630fb6d6120b4231a5d635214b693c997e0b990397258a
|
7
|
+
data.tar.gz: 269e9d3a3fcdb270dfa274d4225a8fa7f2de23280eae137aca3b82a1355f305dcc0fa93c23333a48760004503d9c4336231c588ee8135f1f7ce1434c1a180166
|
data/lib/octokit/connection.rb
CHANGED
@@ -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
|
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
|
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
|
data/lib/octokit/version.rb
CHANGED
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.
|
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-
|
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.
|
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: []
|