lib/rocketio.rb in rocketio-0.2.1 vs lib/rocketio.rb in rocketio-0.3.0
- old
+ new
@@ -60,43 +60,55 @@
CONTENT_TYPE = 'Content-Type'.freeze
DEFAULT_CONTENT_TYPE = 'text/html'.freeze
CONTENT_LENGTH = 'Content-Length'.freeze
CONTENT_DISPOSITION = 'Content-Disposition'.freeze
+
APPLICATION_OCTET_STREAM = 'application/octet-stream'.freeze
+ APPLICATION_JSON = 'application/json'.freeze
+ APPLICATION_JSON_REGEXP = /application\/json/i
+
DEFAULT_AUTH_REALM = 'AccessRestricted'.freeze
DEFAULT_TOKEN_AUTH_REALM = 'Application'.freeze
REQUEST_METHOD = 'REQUEST_METHOD'.freeze
PATH_INFO = 'PATH_INFO'.freeze
HTTP_ACCEPT = 'HTTP_ACCEPT'.freeze
REMOTE_USER = 'REMOTE_USER'.freeze
- HTTP_CONNECTION = 'HTTP_CONNECTION'.freeze
+ HTTP_CONTENT_TYPE = 'CONTENT_TYPE'.freeze
+ HTTP_CONNECTION = 'HTTP_CONNECTION'.freeze
+
HTTP_AUTHORIZATION_KEYS = ['HTTP_AUTHORIZATION', 'X-HTTP_AUTHORIZATION', 'X_HTTP_AUTHORIZATION'].map(&:freeze).freeze
HTTP_AUTHORIZATION_MOCKS = {
basic: 'Basic Og=='.freeze,
digest: 'Digest opaque="", qop="auth", uri="%s"'.freeze
}.freeze
- HTTP_UPGRADE = 'HTTP_UPGRADE'.freeze
- UPGRADE = 'upgrade'.freeze
- WEBSOCKET = 'websocket'.freeze
- HTTP_1_1 = 'HTTP/1.1'.freeze
- HTTP_VERSION = 'HTTP_VERSION'.freeze
- HTTP_X_FORWARDED_HOST = 'HTTP_X_FORWARDED_HOST'.freeze
- HTTP_IF_MATCH = 'HTTP_IF_MATCH'.freeze
- HTTP_IF_NONE_MATCH = 'HTTP_IF_NONE_MATCH'.freeze
- HTTP_IF_MODIFIED_SINCE = 'HTTP_IF_MODIFIED_SINCE'.freeze
+
+ HTTP_UPGRADE = 'HTTP_UPGRADE'.freeze
+
+ UPGRADE = 'upgrade'.freeze
+ WEBSOCKET = 'websocket'.freeze
+
+ HTTP_1_1 = 'HTTP/1.1'.freeze
+ HTTP_VERSION = 'HTTP_VERSION'.freeze
+ HTTP_X_FORWARDED_HOST = 'HTTP_X_FORWARDED_HOST'.freeze
+ HTTP_IF_MATCH = 'HTTP_IF_MATCH'.freeze
+ HTTP_IF_NONE_MATCH = 'HTTP_IF_NONE_MATCH'.freeze
+ HTTP_IF_MODIFIED_SINCE = 'HTTP_IF_MODIFIED_SINCE'.freeze
HTTP_IF_UNMODIFIED_SINCE = 'HTTP_IF_UNMODIFIED_SINCE'.freeze
- HTTP_X_REQUESTED_WITH = 'HTTP_X_REQUESTED_WITH'.freeze
- XML_HTTP_REQUEST = 'XMLHttpRequest'.freeze
+ HTTP_X_REQUESTED_WITH = 'HTTP_X_REQUESTED_WITH'.freeze
+ XML_HTTP_REQUEST = 'XMLHttpRequest'.freeze
- LOCATION = 'Location'.freeze
- CACHE_CONTROL = 'Cache-Control'.freeze
- EXPIRES = 'Expires'.freeze
- LAST_MODIFIED = 'Last-Modified'.freeze
- ETAG = 'ETag'.freeze
- ETAG_KINDS = [:strong, :weak].freeze
+ LOCATION = 'Location'.freeze
+ CACHE_CONTROL = 'Cache-Control'.freeze
+ EXPIRES = 'Expires'.freeze
+ LAST_MODIFIED = 'Last-Modified'.freeze
+
+ ETAG = 'ETag'.freeze
+ ETAG_KINDS = [:strong, :weak].freeze
+
+ RACK_INPUT = 'rack.input'.freeze
DROP_BODY_RESPONSES = {204 => true, 205 => true, 304 => true}.freeze
ERROR_TEMPLATES = begin
path = File.expand_path('../rocketio/error_templates/', __FILE__)