Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
class Grizzlet def service(req) setup_logger info = req.getRequestProcessor() request_uri = req.requestURI.to_s headers = req.getMimeHeaders() # RFC3875 The Common Gateway Interface (CGI) Version 1.1 #ENV['AUTH_TYPE'] = req.getAuthType().to_s ENV['CONTENT_LENGTH'] = info.content_length().to_s ENV['CONTENT_TYPE'] = req.content_type() ENV['GATEWAY_INTERFACE'] = 'CGI/1.1' ENV['PATH_INFO'] = request_uri ENV['PATH_TRANSLATED'] = request_uri.split('?', 2).first ENV['QUERY_STRING'] = req.query_string().to_s ENV['REMOTE_ADDR'] = info.remote_addr() ENV['REMOTE_HOST'] = req.remote_host().to_s ENV['REMOTE_USER'] = req.remote_user().to_s ENV['REQUEST_METHOD'] = info.method() ENV['SCRIPT_NAME'] = '' ENV['SERVER_NAME'] = req.server_name().to_s ENV['SERVER_PORT'] = req.server_port().to_s ENV['SERVER_PROTOCOL'] = req.protocol().to_s ENV['SERVER_SOFTWARE'] = 'Grizzly/1.7' ENV['REQUEST_URI'] = request_uri for i in 0 ... headers.size name = headers.name(i).to_s value = headers.value(i).to_s ENV['HTTP_' + name.upcase.tr('-','_')] = value end if !$root.nil? ActionController::AbstractRequest.relative_url_root = $root ActionController::CgiRequest.relative_url_root = $root end Dispatcher.dispatch end
This paste will be private.
From the Design Piracy series on my blog: