Class: WEBrick::HTTPResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/rackup/handler/webrick.rb

Overview

This monkey patch allows for applications to perform their own chunking through WEBrick::HTTPResponse if rack is set to true.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#rackObject

Returns the value of attribute rack.



13
14
15
# File 'lib/rackup/handler/webrick.rb', line 13

def rack
  @rack
end

Instance Method Details

#_rack_setup_headerObject



15
# File 'lib/rackup/handler/webrick.rb', line 15

alias _rack_setup_header setup_header

#setup_headerObject



16
17
18
19
20
21
22
23
24
# File 'lib/rackup/handler/webrick.rb', line 16

def setup_header
  app_chunking = rack && @header['transfer-encoding'] == 'chunked'

  @chunked = app_chunking if app_chunking

  _rack_setup_header

  @chunked = false if app_chunking
end