提交 8350925b 编写于 作者: E eileencodes

Stop violating law of demeter in response cookie_jar

This adds a new method to request and response so we don't need to
violate the law of demeter.

We are changing `Request` and `Response` so that they always have a
`cookie_jar`

This is a continuation on work to combine integration and controller
test code bases in Rails.
上级 492b1344
......@@ -63,6 +63,9 @@ def initialize(env)
@ip = nil
end
def commit_cookie_jar! # :nodoc:
end
def check_path_parameters!
# If any of the path parameters has an invalid encoding then
# raise since it's likely to trigger errors further on.
......
......@@ -413,7 +413,7 @@ def before_committed
def before_sending
headers.freeze
request.cookie_jar.commit!
request.commit_cookie_jar!
end
def build_buffer(response, body)
......
......@@ -12,6 +12,12 @@ def cookie_jar
end
# :stopdoc:
prepend Module.new {
def commit_cookie_jar!
cookie_jar.commit!
end
}
def have_cookie_jar?
has_header? 'action_dispatch.cookies'.freeze
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册