lib/async/http/body/hijack.rb in async-http-0.54.1 vs lib/async/http/body/hijack.rb in async-http-0.55.0
- old
+ new
@@ -30,16 +30,16 @@
class Hijack < ::Protocol::HTTP::Body::Readable
def self.response(request, status, headers, &block)
::Protocol::HTTP::Response[status, headers, self.wrap(request, &block)]
end
- def self.wrap(request, &block)
- self.new(request.body, &block)
+ def self.wrap(request = nil, &block)
+ self.new(block, request&.body)
end
- def initialize(input = nil, &block)
- @input = input
+ def initialize(block, input = nil)
@block = block
+ @input = input
@task = nil
@stream = nil
end