Class: RawOutput

Inherits:
Object
  • Object
show all
Includes:
Mongrel::HttpHandlerPlugin
Defined in:
lib/mongrel_raw_output/init.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ RawOutput

Returns a new instance of RawOutput.



7
8
9
10
# File 'lib/mongrel_raw_output/init.rb', line 7

def initialize(options = {})
  @request_notify = false
  @header_only = false
end

Instance Method Details

#process(request, response) ⇒ Object



12
13
14
15
16
17
18
19
20
21
# File 'lib/mongrel_raw_output/init.rb', line 12

def process(request, response)
  response.header.out.rewind
  headers = response.header.out.read
  return unless headers.match(/X-Raw-Output/)
  response.instance_variable_set(:@status_sent, true) 
  response.instance_variable_set(:@header_sent, true) 
  response.start(200, true) do |head, body|
    body.write("")
  end
end