File tree 2 files changed +6
-6
lines changed
2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -209,8 +209,8 @@ def parse_query_and_convenience_headers(options)
209
209
210
210
def response_data_correctly_encoded ( response )
211
211
# TODO: I'm guessing base64 content responses are still broken, but this fixes the bug we're running into
212
- content_type = response . headers . fetch ( " content-type" , "" )
213
- return response . data unless content_type . include? ( " charset" ) && response . data . is_a? ( String )
212
+ content_type = response . headers . fetch ( ' content-type' , '' )
213
+ return response . data unless content_type . include? ( ' charset' ) && response . data . is_a? ( String )
214
214
215
215
reported_encoding = content_type . match ( /charset=([^ ]+)/ ) [ 1 ]
216
216
response . data . force_encoding ( reported_encoding )
Original file line number Diff line number Diff line change 26
26
assert_requested :get , github_url ( '/repos/octokit/octokit.rb/contents/lib/octokit.rb' )
27
27
end
28
28
29
- it " returns the contents of a file properly encoded as specified by the response headers" do
30
- contents = @client . contents ( " octokit/octokit.rb" , : path => " spec/fixtures/utf8.en.js" , accept : " application/vnd.github.V3.raw" )
31
- expect ( contents ) . to eq ( File . read ( " spec/fixtures/utf8.en.js" ) )
29
+ it ' returns the contents of a file properly encoded as specified by the response headers' do
30
+ contents = @client . contents ( ' octokit/octokit.rb' , path : ' spec/fixtures/utf8.en.js' , accept : ' application/vnd.github.V3.raw' )
31
+ expect ( contents ) . to eq ( File . read ( ' spec/fixtures/utf8.en.js' ) )
32
32
expect ( contents . encoding ) . to eq ( Encoding ::UTF_8 )
33
- assert_requested :get , github_url ( " /repos/octokit/octokit.rb/contents/spec/fixtures/utf8.en.js" )
33
+ assert_requested :get , github_url ( ' /repos/octokit/octokit.rb/contents/spec/fixtures/utf8.en.js' )
34
34
end
35
35
end # .contents
36
36
You can’t perform that action at this time.
0 commit comments