On 6 Jul 2007, at 12:29, Matthew Palmer wrote:
> > 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. > I can't see any trace of it in edge either (or even a comment explaining a similar fix). A cursory inspection with tcpdump and a current version of Safari suggests it is no longer a problem (According to the changelog the original fix dates back to 2005) and so perhaps this was just removed because affected versions of Safari are effectively dead? Fred --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
