private void Prepare(RubyContext context)
{
if (!Contains(RackEnvironmentVariables.HttpVersion) && Contains(RackEnvironmentVariables.ServerProtocol))
Add(RackEnvironmentVariables.HttpVersion, Get(RackEnvironmentVariables.ServerProtocol));
Remove(RackEnvironmentVariables.Disallowed.HttpContentLength);
Remove(RackEnvironmentVariables.Disallowed.HttpContentType);
if (Get(RackEnvironmentVariables.ContentType) == null ||
Get(RackEnvironmentVariables.ContentType).ToString() == String.Empty)
Remove(RackEnvironmentVariables.ContentType);
if (!Contains(RackEnvironmentVariables.RackErrors))
Add(RackEnvironmentVariables.RackErrors, context.StandardErrorOutput);
string body = Body ?? string.Empty;
Remove(RackEnvironmentVariables.RackInput);
Add(RackEnvironmentVariables.RackInput,
new StringIO(MutableString.CreateMutable(body, RubyEncoding.Default), IOMode.ReadOnly));
}