Module: ServerSide::HTTP

Defined in:
lib/serverside/http.rb,
lib/serverside/http/const.rb,
lib/serverside/http/error.rb,
lib/serverside/http/server.rb,
lib/serverside/http/static.rb,
lib/serverside/http/caching.rb,
lib/serverside/http/request.rb

Defined Under Namespace

Modules: Caching, Server, Static Classes: BadRequestError, ForbiddenError, NotFoundError, PrematureBoundaryError, Request

Constant Summary collapse

VERSION_1_0 =

HTTP versions

'1.0'.freeze
VERSION_1_1 =
'1.1'.freeze
MAX_REQUEST_LINE_SIZE =

maximum sizes compare to mongrel.rubyforge.org/security.html

1024
MAX_HEADER_SIZE =

112KB

112 * 1024
MAX_HEADER_NAME_SIZE =
256
MAX_HEADER_COUNT =

should be enough methinks

256
MAX_PARAMETER_VALUE_SIZE =

10KB

10240
MAX_PARAMETER_NAME_SIZE =

should be enough

64
CONTENT_LENGTH =

request body and response body

'Content-Length'.freeze
CONTENT_TYPE =
'Content-Type'.freeze
MULTIPART_FORM_DATA_RE =
/^multipart\/form-data; boundary=(.+)$/.freeze
CONTENT_DISPOSITION =
'Content-Disposition'.freeze
DISPOSITION_FORM_DATA_RE =
/^form-data; name="([^"]+)"(; filename="([^"]+)")?$/.freeze
FORM_URL_ENCODED =
'application/x-www-form-urlencoded'.freeze
CONNECTION =

connection

'Connection'.freeze
KEEP_ALIVE =
'keep-alive'.freeze
CLOSE =
'close'.freeze
CONNECTION_CLOSE =
"Connection: close\r\n".freeze
HOST =

headers

'Host'.freeze
X_FORWARDED_FOR =
'X-Forwarded-For'.freeze
DATE =
'Date'.freeze
LOCATION =
'Location'.freeze
ACCEPT =
'Accept'.freeze
USER_AGENT =
'User-Agent'.freeze
IF_NONE_MATCH =

caching

'If-None-Match'.freeze
IF_MODIFIED_SINCE =
'If-Modified-Since'.freeze
ETAG =
'ETag'.freeze
LAST_MODIFIED =
'Last-Modified'.freeze
CACHE_CONTROL =
'Cache-Control'.freeze
NO_CACHE =
'no-cache'.freeze
EXPIRES =
'Expires'.freeze
STATUS_OK =

response status

'200 OK'.freeze
STATUS_CREATED =
'201 Created'.freeze
STATUS_ACCEPTED =
'202 Accepted'.freeze
STATUS_NO_CONTENT =
'204 No Content'.freeze
STATUS_MOVED_PERMANENTLY =
'301 Moved Permanently'.freeze
STATUS_FOUND =
'302 Found'.freeze
STATUS_NOT_MODIFIED =
'304 Not Modified'.freeze
STATUS_BAD_REQUEST =
'400 Bad Request'.freeze
STATUS_UNAUTHORIZED =
'401 Unauthorized'.freeze
STATUS_FORBIDDEN =
'403 Forbidden'.freeze
STATUS_NOT_FOUND =
'404 Not Found'.freeze
STATUS_METHOD_NOT_ALLOWED =
'405 Method Not Allowed'.freeze
STATUS_NOT_ACCEPTABLE =
'406 Not Acceptable'.freeze
STATUS_CONFLICT =
'409 Conflict'.freeze
STATUS_REQUEST_ENTITY_TOO_LARGE =
'413 Request Entity Too Large'.freeze
STATUS_REQUEST_URI_TOO_LONG =
'414 Request-URI Too Long'.freeze
STATUS_UNSUPPORTED_MEDIA_TYPE =
'415 Unsupported Media Type'.freeze
STATUS_INTERNAL_SERVER_ERROR =
'500 Internal Server Error'.freeze
STATUS_NOT_IMPLEMENTED =
'501 Not Implemented'.freeze
STATUS_SERVICE_UNAVAILABLE =
'503 Service Unavailable'.freeze
'Cookie'.freeze
'Set-Cookie'.freeze
Time.at(0).freeze