[Nitro] Multipart forms and the request parameters

Chris Farmiloe chris at motionpath.com
Tue Nov 22 10:30:49 EST 2005


yes. I could quiet easily test for this in my nitro app, but what I  
don't think
should be happening is that the request[] calls act differently  
depending on
whether the form was posted with multipart data or not.

if the form was multipart encoded then
puts "hello" if request['no_key']     ==> "hello"

if normal enc-type
puts "hello" if request['no_key']     ==>

just a consistency thing



Chris Farmiloe
Design & Development.

Motionpath Digital Media Ltd.
St Georges road, Brighton, BN2 1ED.
Office: 01273 608708    |    Mobile:    07791 179481




On 22 Nov 2005, at 15:17, Michael Fellinger wrote:

> I don't fully get this one, is it not simpler to do request 
> ['no_key'].empty?
>
> maybe i don't fully understand the situation, but this is what i  
> would do.
>
> Am Dienstag 22 November 2005 15:47 schrieb Chris Farmiloe:
>> Hi listers:
>>
>> Little query to anyone in the know....
>>
>> When a multipart form gets parsed into the @params (request) hash the
>> default value for the contents is set to be a new Array, this  
>> results in
>> request['no_key'] => []
>>
>> and more of a problem..
>>
>> request['no_key'].nil? => false
>>
>> I have patched the request wrapper to fix this and stop the request
>> parameters acting so differently when using multipart forms.
>> using the fetch method
>>
>> but the @params hash still has the default value of an empty array.
>>
>> so.. Is there a legitimate reason for the @params hash to have  
>> default
>> value of an empty array?
>>
>> gmosx: would you like this patch or do you think this should be fixed
>> in cgi.rb when the params hash is built?
>>
>>
>>
>> Chris Farmiloe
>> Design & Development.
>>
>> Motionpath Digital Media Ltd.
>> St Georges road, Brighton, BN2 1ED.
>> Office: 01273 608708    |    Mobile:    07791 179481
> _______________________________________________
> Nitro-general mailing list
> Nitro-general at rubyforge.org
> http://rubyforge.org/mailman/listinfo/nitro-general

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/nitro-general/attachments/20051122/2d21cb06/attachment.html 


More information about the Nitro-general mailing list