Class: HTTP::Features::LineIterableBody

Inherits:
Feature
  • Object
show all
Defined in:
lib/http/features/line_iterable_body.rb

Defined Under Namespace

Classes: IterableBodyWrapper

Instance Method Summary collapse

Instance Method Details

#wrap_response(response) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/http/features/line_iterable_body.rb', line 6

def wrap_response(response)
  options = {
    status: response.status,
    version: response.version,
    headers: response.headers,
    proxy_headers: response.proxy_headers,
    connection: response.connection,
    body: IterableBodyWrapper.new(response.body, response.body.instance_variable_get(:@encoding)),
    request: response.request
  }

  HTTP::Response.new(options)
end