aboutsummaryrefslogtreecommitdiffstats
path: root/lib/cgi/core.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-06-01 00:42:06 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-06-01 00:42:06 +0000
commitb8f3f2d62e62fa8ebfd4e59656173813ec96672a (patch)
treea96d7d09b9d48de11b330a97d306184998a502a9 /lib/cgi/core.rb
parent5dcb4fc18b38591d111e8c71667e65021b51cbdd (diff)
downloadruby-b8f3f2d62e62fa8ebfd4e59656173813ec96672a.tar.gz
* lib/cgi/util.rb: Improve documentation. Patch by Kuba Fietkiewicz.
[Ruby 1.9 - Bug #4775] * lib/cgi/core.rb: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31882 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/cgi/core.rb')
-rw-r--r--lib/cgi/core.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/cgi/core.rb b/lib/cgi/core.rb
index a756ab5542..5759fd44bd 100644
--- a/lib/cgi/core.rb
+++ b/lib/cgi/core.rb
@@ -17,6 +17,7 @@ class CGI
REVISION = '$Id$' #:nodoc:
+ # Whether processing will be required in binary vs text
NEEDS_BINMODE = File::BINARY != 0
# Path separators in different environments.
@@ -450,6 +451,15 @@ class CGI
@params.update(hash)
end
+ ##
+ # Parses multipart form elements according to
+ # http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.2
+ #
+ # Returns a hash of multipart form parameters with bodies of type StringIO or
+ # Tempfile depending on whether the multipart form element exceeds 10 KB
+ #
+ # params[name => body]
+ #
def read_multipart(boundary, content_length)
## read first boundary
stdin = $stdin
@@ -655,6 +665,7 @@ class CGI
end
private :initialize_query
+ # Returns whether the form contained multipart/form-data
def multipart?
@multipart
end
@@ -705,7 +716,6 @@ class CGI
#
# CGI.accept_charset = "EUC-JP"
#
-
@@accept_charset="UTF-8"
# Return the accept character set for all new CGI instances.