Parent

Unicorn::CGIWrapper

The beginning of a complete wrapper around Unicorn’s internal HTTP processing system but maintaining the original Ruby CGI module. Use this only as a crutch to get existing CGI based systems working. It should handle everything, but please notify us if you see special warnings. This work is still very alpha so we need testers to help work out the various corner cases.

Constants

CHARSET
CONNECTION
CONTENT_LENGTH
CONTENT_TYPE
COOKIE
HEADER_MAP

this maps CGI header names to HTTP header names

NPH

these are stripped out of any keys passed to CGIWrapper.header function

RACK_ERRORS
RACK_INPUT
SET_COOKIE

some of these are common strings, but this is the only module using them and the reason they’re not in Unicorn::Const

STATUS
Status

Attributes

body[R]
env_table[R]

Public Class Methods

new(rack_env, *args) view method source

Takes an a Rackable environment, plus any additional CGI.new arguments These are used internally to create a wrapper around the real CGI while maintaining Rack/Unicorn’s view of the world. This this will NOT deal well with large responses that take up a lot of memory, but neither does the CGI nor the original CGIWrapper from Mongrel…

Public Instance Methods

header(options = "text/html") view method source

The header is typically called to send back the header. In our case we collect it into a hash for later usage. This can be called multiple times to set different cookies.

out(options = "text/html") view method source

The dumb thing is people can call header or this or both and in any order. So, we just reuse header and then finalize the HttpResponse the right way. This will have no effect if called the second time if the first “outputted” anything.

rack_response() view method source

finalizes the response in a way Rack applications would expect

Used to wrap the normal stdinput variable used inside CGI.

stdoutput() view method source

return a pointer to the StringIO body since it’s STDOUT-like

Originally generated with the Darkfish Rdoc Generator 2, modified by wrongdoc.

We love to hear from you!
Email patches (with git send-email), pull requests, questions, bug reports, suggestions, etc. to us publically at mongrel-unicorn@rubyforge.org.
No subscription to the mailing list is necessary, just let us know to Cc: you if you're unsubscribed.
To subscribe, email mongrel-unicorn-request@rubyforge.org with "subscribe" in the Subject and respond to the automated confirmation message.
Do not waste bandwidth with HTML, HTML mail will not be read.
Quote only parts you're responding to and do not top post.
For sensitive topics, email us privately at unicorn@bogomips.org.