Aaron Smith
2007-Aug-21 19:36 UTC
ActionPack raw_post_data_fix.rb#read_body bug with AMF data.
Hey Everyone, I just found a slight problem with the "read_body" method in raw_post_data_fix.rb. This line: # Fix for Safari Ajax postings that always append \000 content.chop! if content[-1] == 0 This causes problems with Flash AMF binary format. As AMF always appends a \000 to the stream as well. I''m the developer over at RubyAMF and have been running into problems with AMF data being truncated in the Rails plugin. This is the cause of it. So can a condition be put in the method so that if the content-type is "application/x-amf" that it doesn''t "chop" the data. I''ve changed the method to this and it fixes the problem: --snip content_type = env_table[''CONTENT_TYPE''] if content[-1] == 0 && content_type != ''application/x-amf'' content.chop! if content[-1] == 0 end --snip I can talk with whomever is developing actionpack to give you a supporting test cast and how to see what happens with AMF. I would really appreciate this, as it''s a knee breaker for RubyAMF. Thanks much Aaron Smith -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Aaron Smith
2007-Aug-21 19:44 UTC
Re: ActionPack raw_post_data_fix.rb#read_body bug with AMF d
whoops, that method should be: if content[-1] == 0 && content_type != ''application/x-amf'' content.chop! #### end -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Aaron Smith
2007-Aug-22 13:11 UTC
Re: ActionPack raw_post_data_fix.rb#read_body bug with AMF d
Just an update. I can handle this issue with Rails truncating the last byte, but just for future AMF support in Rails it would be good to have that in there. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---