I am using RailsDAV and found that some files (binary zip files) were not transmitted correctly using the put method. The file size was reduced by one byte.
As it turned out the read_body method strips off a trailing zero. Apparently this behaviour is supposed to be a fix for Safari but unfortunately it breaks the transmission of binary data, too.
Could this be improved in a way that the chomp! would only be executed if the client is Safari?
In actionpack 1.13.3 the code is in file lib/action_controller/cgi_ext/raw_post_data_fix.rb:
class CGI
module QueryExtension
def read_body(content_length)
# Fix for Safari Ajax postings that always append \000
content.chop! if content[-1] == 0
end
end
end
In trunk the code was moved to root/trunk/actionpack/lib/action_controller/cgi_ext/query_extension.rb, but the bug still exists.