This project is archived and is in readonly mode.
ParamsParser and request body streams
Reported by Brian Lopez | May 17th, 2009 @ 04:12 AM | in 3.0.2
Per Joshua's request from:
http://groups.google.com/group/rubyonrails-core/browse_thread/threa...
This is a patch adding support to the XML and JSON plugable backends to be able to parse from a string, or an IO (for streaming). The ParamsParser middleware was also updated to pass the request.body IO object directly to the parsers.
It also includes a JSON parsing backend for yajl-ruby (streaming JSON parser in C).
Comments and changes to this ticket
-
Brian Lopez May 17th, 2009 @ 04:12 AM
just uploading it with a .diff extension, per the docs on how to submit a patch
-
Brian Lopez May 17th, 2009 @ 04:23 AM
Although I've only added support such that the API doesn't break for the existing parsers, the only one that actually parses off the IO itself (without simply converting itself into a string because said backend can't parse as a stream) is the JSON backend yajl-ruby.
Although, the idea here is that backends like libxml and/or nokogiri could also be refactored at some point to support parsing directly off the IO. Not to say the others couldn't as well, or future parsers that will either be integrated into core, or as plugins.
-
Repository May 17th, 2009 @ 04:38 PM
- State changed from new to resolved
(from [53dda29f8b34073a4b135ee224c1d09c1f10de02]) Add support for parsing XML and JSON from an IO as well as a string [#2659 state:resolved]
Signed-off-by: Joshua Peek josh@joshpeek.com
http://github.com/rails/rails/commit/53dda29f8b34073a4b135ee224c1d0... -
Brian Lopez May 17th, 2009 @ 05:52 PM
What was the reason for removing the yajl-ruby backend and updated JSON test?
I realize now that I should have noted somewhere that the JSON test and yajl.rb backend were written by Rick Olson, and I merged them into my local clone. -
Brian Lopez May 17th, 2009 @ 06:44 PM
Also, YAML.load_stream was changed back to YAML.load - was this because I didn't specify that in the ticket subject?
-
josh May 17th, 2009 @ 07:48 PM
Yeah, I held off on the yajl. I figured Rick was working on that or something. Can you make a special ticket for that and assign it to him.
I had to revert the YAML change because it broke a bunch of tests. YAML.load_stream doesn't return a string, it returns some weird YAML IO thing. I couldn't get it to work right. Accepting updates ;)
-
Brian Lopez May 17th, 2009 @ 08:44 PM
I must have missed this in the docs, but apparently YAML.load can accept an IO. Appears to work exactly like passing it a string.
-
Brian Lopez May 31st, 2009 @ 02:50 AM
So I know this ticket has been marked resolved, but this patch compliments the other two by enabling true IO parsing for the libxml, nokogiri and rexml backends.
Any chances to get this in as well? Should I create a new ticket?
-
josh May 31st, 2009 @ 05:51 AM
- Milestone cleared.
- State changed from resolved to open
Thanks, I'll commit it soon.
Next time, just open a new ticket with the additional changes.
-
Repository June 9th, 2009 @ 03:02 PM
- State changed from open to resolved
(from [69bc2043f93890048e415dd7c5f1feba5a20d145]) enable real IO parsing for the libxml, nokogiri and rexml backends [#2659 state:resolved]
Signed-off-by: Joshua Peek josh@joshpeek.com
http://github.com/rails/rails/commit/69bc2043f93890048e415dd7c5f1fe... -
Jeff Kreeftmeijer November 7th, 2010 @ 04:52 PM
- Tag cleared.
- Importance changed from to Low
Automatic cleanup of spam.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Referenced by
- 2659 ParamsParser and request body streams (from [53dda29f8b34073a4b135ee224c1d09c1f10de02]) Add sup...
- 2659 ParamsParser and request body streams (from [69bc2043f93890048e415dd7c5f1feba5a20d145]) enable ...