Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitda5a307

Browse files
committed
Fixed for response stubbing with headers for streaming responses.
Fixesamazon-archives/aws-sdk-core-ruby#220
1 parentc32bc08 commitda5a307

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

‎aws-sdk-core/lib/seahorse/client/plugins/restful_bindings.rb‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ def parse_response(response)
6969
status_code=response.context.http_response.status_code
7070
response.data[key]=status_code
7171
when'header'
72-
response.data[key]=extract_header(headers,shape)
72+
ifheaders.key?(shape.location_name)
73+
response.data[key]=extract_header(headers,shape)
74+
end
7375
when'headers'
7476
response.data[key]=extract_header_map(headers,shape)
7577
end

‎aws-sdk-core/spec/aws/stubbing/stub_spec.rb‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,13 +195,15 @@ module ClientStubs
195195

196196
it'stubs the HTTP response target when with streaming APIs'do
197197
s3=S3::Client.new(stub_responses:true)
198-
s3.stub_responses(:get_object,{body:'data'})
198+
s3.stub_responses(:get_object,{body:'data',content_length:4})
199199
io=StringIO.new
200200
resp=s3.get_object(bucket:'bucket',key:'key',response_target:io)
201201
expect(resp.body.read).toeq('data')
202202
expect(resp.body).tobe(io)
203203
expect(resp.context.http_response.body).tobe(io)
204+
expect(resp.content_length).toeq(4)
204205
end
206+
205207
end
206208
end
207209
end

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp