diff options
author | Konstantin Haase <konstantin.mailinglists@googlemail.com> | 2014-10-02 15:35:27 +0200 |
---|---|---|
committer | Konstantin Haase <konstantin.mailinglists@googlemail.com> | 2014-10-02 15:35:27 +0200 |
commit | ab172af1b63f0d8e91ce579dd2907c43b96cf82a (patch) | |
tree | 991037ede0df148b5aef7137f321591401f98d53 /lib/rack/request.rb | |
parent | a71be3c914c10d1089238f4e21b029b885be4029 (diff) | |
parent | dc53a8c26dc55d21240233b3d83d36efdef6e924 (diff) | |
download | rack-ab172af1b63f0d8e91ce579dd2907c43b96cf82a.tar.gz |
Merge pull request #737 from schneems/schneems/less-objects
Less allocated objects on each request
Diffstat (limited to 'lib/rack/request.rb')
-rw-r--r-- | lib/rack/request.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/rack/request.rb b/lib/rack/request.rb index 602d0d64..e6e46e9d 100644 --- a/lib/rack/request.rb +++ b/lib/rack/request.rb @@ -18,10 +18,10 @@ module Rack end def body; @env["rack.input"] end - def script_name; @env["SCRIPT_NAME"].to_s end - def path_info; @env["PATH_INFO"].to_s end + def script_name; @env[SCRIPT_NAME].to_s end + def path_info; @env[PATH_INFO].to_s end def request_method; @env["REQUEST_METHOD"] end - def query_string; @env["QUERY_STRING"].to_s end + def query_string; @env[QUERY_STRING].to_s end def content_length; @env['CONTENT_LENGTH'] end def content_type @@ -116,10 +116,10 @@ module Rack def delete?; request_method == "DELETE" end # Checks the HTTP request method (or verb) to see if it was of type GET - def get?; request_method == "GET" end + def get?; request_method == GET end # Checks the HTTP request method (or verb) to see if it was of type HEAD - def head?; request_method == "HEAD" end + def head?; request_method == HEAD end # Checks the HTTP request method (or verb) to see if it was of type OPTIONS def options?; request_method == "OPTIONS" end @@ -173,7 +173,7 @@ module Rack # Content-Type header is provided and the request_method is POST. def form_data? type = media_type - meth = env["rack.methodoverride.original_method"] || env['REQUEST_METHOD'] + meth = env["rack.methodoverride.original_method"] || env[REQUEST_METHOD] (meth == 'POST' && type.nil?) || FORM_DATA_MEDIA_TYPES.include?(type) end |