Skip to content

Commit

Permalink
Fix FrozenError in Typhoeus streaming response body
Browse files Browse the repository at this point in the history
See bblimke#1078

This fork & fix should be unnecessary once the above PR gets merged and
a new version of webmock is released.
  • Loading branch information
patrickjaberg committed Jan 25, 2025
1 parent 9ff63ac commit 4de592c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/webmock/http_lib_adapters/typhoeus_hydra_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def self.request_hash(request_signature)
request.execute_headers_callbacks(response)
end
if request.respond_to?(:streaming?) && request.streaming?
response.options[:response_body] = ""
response.options[:response_body] = "".dup
request.on_body.each { |callback| callback.call(webmock_response.body, response) }
end
request.finish(response)
Expand Down

0 comments on commit 4de592c

Please sign in to comment.