[Nitro] Solved: OgAdminController#save is not the problem....
Trans
transfire at gmail.com
Thu Nov 1 23:45:57 EDT 2007
On Nov 1, 10:52 pm, Robert Mela <r... at robmela.com> wrote:
> Problem found. The correct fix for OgAdminController#save is not in
> OgAdminController. It's in Cgi#parse_params
>
> Before a fix can be implemented there should be a decision as to whether
> post and get params should be hash or dictionary.
>
> Plain old POST request bodies are parsed using Cgi#parse_query_string (
> sic ) and that returns a Dictonary:
>
> context.post_params = parse_query_string(data)
>
> Multipart form data is parsed using Cgi#parse_multipart, which returns a
> Hash
>
> context.post_params = parse_multipart(context, boundary)
>
> ... and which also conveniently contains the comment
>
> #--
> # TODO: RECODE THIS CRAP!
> #++
>
> If a decision is reached that Dictionary is to be used for form data
> then the following initializations in Context#initialize would need to
> be changed:
>
> @post_params = {}
> @get_params = {}
>
> So, having no shame, I'll ask a stupid question: Why Dictionary for
> request params? Also, does using Dictionary for some collection (
> post/get params ) and Hash for others ( headers) risk being
> counterintuitive? I think it's reasonable to think of headers and
> params as collections, and for a programmer to expect them to expose the
> same syntax.
Is there a reason for these to maintain order?
T.
More information about the Nitro-general
mailing list