Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
74f2b41c
R
rails
项目概览
张重言
/
rails
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rails
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
74f2b41c
编写于
6月 02, 2013
作者:
K
kennyj
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove Mime::Type#verify_request? and Mime::Type.browser_generated_types were deprecated.
上级
6ff923a1
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
0 addition
and
37 deletion
+0
-37
actionpack/lib/action_dispatch/http/mime_type.rb
actionpack/lib/action_dispatch/http/mime_type.rb
+0
-16
actionpack/test/dispatch/mime_type_test.rb
actionpack/test/dispatch/mime_type_test.rb
+0
-5
actionpack/test/dispatch/rack_test.rb
actionpack/test/dispatch/rack_test.rb
+0
-16
未找到文件。
actionpack/lib/action_dispatch/http/mime_type.rb
浏览文件 @
74f2b41c
...
@@ -53,10 +53,6 @@ class Type
...
@@ -53,10 +53,6 @@ class Type
@@html_types
=
Set
.
new
[
:html
,
:all
]
@@html_types
=
Set
.
new
[
:html
,
:all
]
cattr_reader
:html_types
cattr_reader
:html_types
# 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
# only needs to protect against these types.
@@browser_generated_types
=
Set
.
new
[
:html
,
:url_encoded_form
,
:multipart_form
,
:text
]
attr_reader
:symbol
attr_reader
:symbol
@register_callbacks
=
[]
@register_callbacks
=
[]
...
@@ -272,18 +268,6 @@ def =~(mime_type)
...
@@ -272,18 +268,6 @@ def =~(mime_type)
end
end
end
end
# Returns true if Action Pack should check requests using this Mime Type for possible request forgery. See
# ActionController::RequestForgeryProtection.
def
verify_request?
ActiveSupport
::
Deprecation
.
warn
"Mime::Type#verify_request? is deprecated and will be removed in Rails 4.1"
@@browser_generated_types
.
include?
(
to_sym
)
end
def
self
.
browser_generated_types
ActiveSupport
::
Deprecation
.
warn
"Mime::Type.browser_generated_types is deprecated and will be removed in Rails 4.1"
@@browser_generated_types
end
def
html?
def
html?
@@html_types
.
include?
(
to_sym
)
||
@string
=~
/html/
@@html_types
.
include?
(
to_sym
)
||
@string
=~
/html/
end
end
...
...
actionpack/test/dispatch/mime_type_test.rb
浏览文件 @
74f2b41c
...
@@ -185,11 +185,6 @@ class MimeTypeTest < ActiveSupport::TestCase
...
@@ -185,11 +185,6 @@ class MimeTypeTest < ActiveSupport::TestCase
all_types
.
uniq!
all_types
.
uniq!
# Remove custom Mime::Type instances set in other tests, like Mime::GIF and Mime::IPHONE
# Remove custom Mime::Type instances set in other tests, like Mime::GIF and Mime::IPHONE
all_types
.
delete_if
{
|
type
|
!
Mime
.
const_defined?
(
type
.
upcase
)
}
all_types
.
delete_if
{
|
type
|
!
Mime
.
const_defined?
(
type
.
upcase
)
}
assert_deprecated
do
verified
,
unverified
=
all_types
.
partition
{
|
type
|
Mime
::
Type
.
browser_generated_types
.
include?
type
}
assert
verified
.
each
{
|
type
|
assert
Mime
.
const_get
(
type
.
upcase
).
verify_request?
,
"Verifiable Mime Type is not verified:
#{
type
.
inspect
}
"
}
assert
unverified
.
each
{
|
type
|
assert
!
Mime
.
const_get
(
type
.
upcase
).
verify_request?
,
"Nonverifiable Mime Type is verified:
#{
type
.
inspect
}
"
}
end
end
end
test
"references gives preference to symbols before strings"
do
test
"references gives preference to symbols before strings"
do
...
...
actionpack/test/dispatch/rack_test.rb
浏览文件 @
74f2b41c
...
@@ -174,22 +174,6 @@ class RackRequestParamsParsingTest < BaseRackTest
...
@@ -174,22 +174,6 @@ class RackRequestParamsParsingTest < BaseRackTest
end
end
end
end
class
RackRequestContentTypeTest
<
BaseRackTest
test
"html content type verification"
do
assert_deprecated
do
@request
.
env
[
'CONTENT_TYPE'
]
=
Mime
::
HTML
.
to_s
assert
@request
.
content_mime_type
.
verify_request?
end
end
test
"xml content type verification"
do
assert_deprecated
do
@request
.
env
[
'CONTENT_TYPE'
]
=
Mime
::
XML
.
to_s
assert
!
@request
.
content_mime_type
.
verify_request?
end
end
end
class
RackRequestNeedsRewoundTest
<
BaseRackTest
class
RackRequestNeedsRewoundTest
<
BaseRackTest
test
"body should be rewound"
do
test
"body should be rewound"
do
data
=
'foo'
data
=
'foo'
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录