@@ -181,12 +181,8 @@ module Plugins
181
181
expect ( headers [ 'x-amz-decoded-content-length' ] ) . to eq ( '11' )
182
182
# capture the body by reading it into a new IO object
183
183
body = StringIO . new
184
- if ( defined? ( JRUBY_VERSION ) )
185
- body << context . http_request . body . read ( 1000 , String . new ) + context . http_request . body . read ( 1000 , String . new )
186
- else
187
- # IO.copy_stream is the same method used by Net::Http to write our body to the socket
188
- IO . copy_stream ( context . http_request . body , body )
189
- end
184
+ # IO.copy_stream is the same method used by Net::Http to write our body to the socket
185
+ IO . copy_stream ( context . http_request . body , body )
190
186
body . rewind
191
187
expect ( body . read ) . to eq "b\r \n Hello World\r \n 0\r \n x-amz-checksum-sha256:pZGm1Av0IEBKARczz7exkNYsZb8LzaMrV7J32a2fFG4=\r \n \r \n "
192
188
end )
@@ -195,11 +191,11 @@ module Plugins
195
191
end
196
192
197
193
it 'handles header-based auth with checksum in header' do
198
- client . stub_responses ( :some_operation , -> ( context ) do
199
- expect ( context . http_request . headers [ 'x-amz-checksum-sha256' ] ) . to eq ( 'pZGm1Av0IEBKARczz7exkNYsZb8LzaMrV7J32a2fFG4=' )
200
- expect ( context . http_request . body . read ) . to eq ( 'Hello World' )
201
- end )
202
- client . some_operation ( checksum_algorithm : 'sha256' , body : 'Hello World' )
194
+ client . stub_responses ( :some_operation , -> ( context ) do
195
+ expect ( context . http_request . headers [ 'x-amz-checksum-sha256' ] ) . to eq ( 'pZGm1Av0IEBKARczz7exkNYsZb8LzaMrV7J32a2fFG4=' )
196
+ expect ( context . http_request . body . read ) . to eq ( 'Hello World' )
197
+ end )
198
+ client . some_operation ( checksum_algorithm : 'sha256' , body : 'Hello World' )
203
199
end
204
200
205
201
it 'handles sigv4-streaming auth with checksum in trailer' do
0 commit comments