提交 8c197fb4 编写于 作者: M Michael Koziarski

Add text/plain to the browser_generated_types array as webkit and gecko can submit them.

For more information see:

http://pseudo-flaw.net/content/web-browsers/form-data-encoding-roundup/
上级 2530d0ee
...@@ -25,7 +25,7 @@ class Type ...@@ -25,7 +25,7 @@ class Type
# These are the content types which browsers can generate without using ajax, flash, etc # These are the content types which browsers can generate without using ajax, flash, etc
# i.e. following a link, getting an image or posting a form. CSRF protection # i.e. following a link, getting an image or posting a form. CSRF protection
# only needs to protect against these types. # only needs to protect against these types.
@@browser_generated_types = Set.new [:html, :url_encoded_form, :multipart_form] @@browser_generated_types = Set.new [:html, :url_encoded_form, :multipart_form, :text]
cattr_reader :browser_generated_types cattr_reader :browser_generated_types
...@@ -177,7 +177,7 @@ def ==(mime_type) ...@@ -177,7 +177,7 @@ def ==(mime_type)
end end
# Returns true if Action Pack should check requests using this Mime Type for possible request forgery. See # Returns true if Action Pack should check requests using this Mime Type for possible request forgery. See
# ActionController::RequestForgerProtection. # ActionController::RequestForgeryProtection.
def verify_request? def verify_request?
browser_generated? browser_generated?
end end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册