about summary refs log tree commit homepage
path: root/lib/unicorn/cgi_wrapper.rb
DateCommit message (Collapse)
2009-09-27cgi_wrapper: use Array#concat instead of +=
Array#concat avoids an intermediate Array object from being allocated (yes, still supporting Rails <= 1.2.x apps...)
2009-09-27cgi_wrapper: simplify status handling in response
Our HttpResponse class interprets non-Integer string status now as well as falling back if it can't be looked up.
2009-09-27cgi_wrapper: don't warn about stdoutput usage
It really shouldn't be a problem for existing CGI apps to write to the StringIO object..
2009-09-27Remove "Z" constant for binary strings
We've started using magic comments to ensure any strings we create are binary instead. Additionally, ensure we create any StringIO objects with an explicit string (which default to binary) to ensure the StringIO object is binary. This is because StringIO.new (with no arguments) will always use the process-wide default encoding since it does not know about magic comments (and couldn't, really...)
2009-09-16Avoid freezing objects that don't benefit from it
This gives applications more rope to play with in case they have any reasons for changing some values of the default constants. Freezing strings for Hash assignments still speeds up MRI, so we'll keep on doing that for now (and as long as MRI supports frozen strings, I expect them to always be faster for Hashes though I'd be very happy to be proven wrong...)
2009-09-08"encoding: binary" comments for all sources (1.9)
This ensures any string literals that pop up in *our* code will just be a bag of bytes. This shouldn't affect/fix/break existing apps in most cases, but most constants will always have the "correct" encoding (none!) to be consistent with HTTP/socket expectations. Since this comment affects things only on a per-source basis, it won't affect existing apps with the exception of strings we pass to the Rack application. This will eventually allow us to get rid of that Unicorn::Z constant, too.
2009-04-12old_rails: try harder to ensure valid responses
Hopefully the world will just move to Rack faster so we have less things to worry about.
2009-04-01cgi_wrapper: HTTP status code cleanups
The default status was 404 in Mongrel and this is needed to work with older versions of Rails. Additionally parse the "Status:" header if it ever got set and the actual "status" code passed to CGI::headers was not set.
2009-04-01cgi_wrapper: fix cookies and other headers
The @output_cookies instance variable was being ignored, and some versions of Rails uses that. Additionally, cleanup multi-value headers in general to avoid dropping headers.
2009-03-30cgi_wrapper: ensure "Status:" header is not set
Rack does not like it; instead try to set it as the @status code if possible.
2009-03-23unicorn_rails: support non-Rack versions of Rails
This resurrects old code from Mongrel to wrap the Rails Dispatcher for older versions of Rails. It seems that Rails >= 2.2.0 support Rack, but only >=2.3 requires it. I'd like to support Rails 1.2.x for a while, too.