Has anyone ever run into any problems with rails truncating
raw_post_data. My situation is this: I’m the developer for RubyAMF
(wiki.rubyamf.org). Which is a flash remoting application server. With
the rails plugin, it allows flash to talk to a controller and return AMF
data…
So long story short, the flash player makes a request to a rails
controller sending AMF binary format in the raw_post, but I’m having
inconsistent behavior with AMF data being incomplete.
I’ve narrowed it rails now and am looking for a foot in the right
direction. Either in debugging this myself, or if someone has run into
this…
Right now I grab the raw request like so: request.env[“RAW_POST_DATA”].
This is what is being inconsistent in rails.
I’ve verified this because I can run RubyAMF as a standalone application
server, (takes rails out of the process), and this one bug (incomplete
AMF) that I’m running into NEVER happens. meaning the flash player is
always sending correct AMF, RubyAMF is handling it perfect. But now with
the rails plugin AMF data is being truncated at some point, for some
random reason.
So, does anyone have any ideas? run into this? where to debug??
I may be way off beam, but if you are using lighttpd:-
I recall having a problem with my raw post data being truncated after
an update to lighttpd, this occurred because I didnt have the mimetype
listed.
just a thought
Tonypm
not off base, good though. At least I know someone else has seen this.
So far it happens with webrick, mongrel, and i"m guessing it will with
lighttpd. I’ll lighttpd tonight.
What kind of route did you go to debug this? It seems like more of an
issue with Rails, as it’s happening with two of the servers.
I’m going to dig into rails and see where the “request” variable is
being setup. I’m thinking I can put some debugging there… Double
checking that the raw post is correctly coming through the request from
all servers… if it is, then somewhere in rails it’s being truncated.
I’m seeing the same problem with attachment_fu when saving the image
to the database. When I try to display the image, only 40k appears in
the browser and with some images even that much is not visible (just
garbage when I view source).
Have you heard anything further regarding the bug fix to ActionPack?
But AMF data always appends a \000 as well. So this was causing it to be
truncated.
Now to talk to whomever develops actionpack.
Thanks a million for identifying this. I’ve just spent n hours trying to
fix the same problem - funnily enough, also with a Ruby AMF parser I’ve
written - and had just decided on the solution of appending a null byte
to the end of the data. I’m reassured to find that this won’t just be a
quick-and-dirty fix and that there’s actually a real bug that causes me
to do that.
I’m seeing the same problem with attachment_fu when saving the image
to the database. When I try to display the image, only 40k appears in
the browser and with some images even that much is not visible (just
garbage when I view source).
Have you heard anything further regarding the bug fix to ActionPack?
I know it was a registered bug in the Rails trac system. That’s about as
far as I went. In the plugin that I wrote for rails I just handled the
one case where this was causing an issue.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.