提交 62ec1a53 编写于 作者: J Jamis Buck

Drop trailing \000 if present on RAW_POST_DATA (works around bug in Safari...

Drop trailing \000 if present on RAW_POST_DATA (works around bug in Safari Ajax implementation) #918


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2106 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 7a0e1bd5
*SVN*
* Drop trailing \000 if present on RAW_POST_DATA (works around bug in Safari Ajax implementation) #918
* Fix observe_field to fall back to event-based observation if frequency <= 0 #1916 [michael@schubert.cx]
* Allow use of the :with option for submit_to_remote #1936 [jon@instance-design.co.uk]
......
......@@ -52,7 +52,9 @@ def read_params_from_query
def read_params_from_post
stdinput.binmode if stdinput.respond_to?(:binmode)
content = stdinput.read(Integer(env_table['CONTENT_LENGTH'])) || ''
env_table['RAW_POST_DATA'] = content.split("&_").first.to_s.freeze # &_ is a fix for Safari Ajax postings that always append \000
# fix for Safari Ajax postings that always append \000
content = content.chop if content[-1] == 0
env_table['RAW_POST_DATA'] = content.freeze
end
def read_query_params(method)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册