Class: Klenod::Rack::Response

Inherits:
Data
  • Object
show all
Defined in:
lib/klenod/rack/asset_app.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#body ⇒ Object (readonly)

Returns the value of attribute body

Returns:

  • (Object) —

    the current value of body



8
9
10
# File 'lib/klenod/rack/asset_app.rb', line 8

def body
  @body
end

#headers ⇒ Object (readonly)

Returns the value of attribute headers

Returns:

  • (Object) —

    the current value of headers



8
9
10
# File 'lib/klenod/rack/asset_app.rb', line 8

def headers
  @headers
end

#status ⇒ Object (readonly)

Returns the value of attribute status

Returns:

  • (Object) —

    the current value of status



8
9
10
# File 'lib/klenod/rack/asset_app.rb', line 8

def status
  @status
end

Instance Method Details

#protocol_response ⇒ Object



13
14
15
16
17
18
19
# File 'lib/klenod/rack/asset_app.rb', line 13

def protocol_response
  require "protocol/http/response"

  # Protocol servers derive content-length from the body. Keeping ours
  # sends it twice, which HTTP/2 clients reject.
  Protocol::HTTP::Response[status, headers.except("content-length"), [body]]
end

#rack_response ⇒ Object



9
10
11
# File 'lib/klenod/rack/asset_app.rb', line 9

def rack_response
  [status, headers, [body]]
end