On Fri, Jul 06, 2007 at 11:29:40AM +0100, Frederick Cheung wrote:
> occasionally the last byte of the post body was going missing. I
> tracked it down to the following method in action_controller/cgi_ext/
> raw_post_data_fix:
>
> def read_body(content_length)
> stdinput.binmode if stdinput.respond_to?(:binmode)
> content = stdinput.read(content_length) || ''
> # Fix for Safari Ajax postings that always append \000
> content.chop! if content[-1] == 0
> content.gsub!(/&_=$/, '')
> env_table['RAW_POST_DATA'] = content.freeze
> end
>
> I don't know the history behind the truncation of the last byte if
> it is nil, but surely there has to be a better way to do this?
The comment at least gives a bit of context -- that Safari is broken, and
this is a workaround for it.
I've done a bit of sleuthing, though, and I can't find this code in Edge. It
is present in 1.2.3, but it's since been removed by the look of it. Bug
#918 is related to this code a bit, but isn't the cause of it's original
inclusion. Since the entire raw_post_data_fix.rb file is gone, I'd say that
a fair amount of refactoring has gone into that part of the code since the
release of 1.2.3. I suspect that going to Edge might be easier than trying
to retrofit whatever improved fix has been made.
- Matt
--
"The day when Hurd is so common that we want to emulate its braindamages is
not going to be in my life-time, I suspect."
-- Linus Torvalds
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---