Class: RawOutput
- Inherits:
-
Object
- Object
- RawOutput
- Includes:
- Mongrel::HttpHandlerPlugin
- Defined in:
- lib/mongrel_raw_output/init.rb
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ RawOutput
constructor
A new instance of RawOutput.
- #process(request, response) ⇒ Object
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( = {}) @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 |