Request object

3 views
Skip to first unread message

Stefan Agner

unread,
Jun 20, 2011, 6:13:59 AM6/20/11
to aspen...@googlegroups.com
Hello,

Recently I started working on a little Aspen project. Today I tried to
read form data submitted via POST request. The keys are using lower
and upper case letters. The request object doesn't gave me the
expected result, this returned nothing:

request.header.one('myVar')

I created a fork on Github and fixed that bug.

https://github.com/falstaff84/aspen/commit/840d960d11ecc0586c3f1a384b31032db39cce62

There are some other problems with the request object: The has method
doesnt exist (i'm using __contains___ now), but this also use .lower()
to get the value from the dictionary. Now, either the add method
should use .lower() as well, or we should remove all those .lower()
when accessing the dictionary.

What was the idea of using .lower() here? Have the keys to be case
insensitive? Is there a standard which defines that?


Thanks
falstaff

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

Chad Whitacre

unread,
Jun 22, 2011, 12:16:54 AM6/22/11
to Stefan Agner, aspen-users
Thanks Stefan! Pull request merged and released (w/ tests) as 0.10.14:



chad




On Tue, Jun 21, 2011 at 4:02 PM, Stefan Agner <fals...@deheime.ch> wrote:
Hi Chad,

Yeah I got that! In my Github repository I added some patch which also took care of that. It seems to work pretty well, fell free to pull from my tree :-) Cheers
Stefan


Am 21.06.2011 16:18, schrieb Chad Whitacre:
Thanks for catching that Stefan. It's more complicated because the underlying object is also used for HTTP headers, which do need to be case insensitive.


chad



On Mon, Jun 20, 2011 at 6:13 AM, Stefan Agner <fals...@deheime.ch <mailto:fals...@deheime.ch>> wrote:

   Hello,

   Recently I started working on a little Aspen project. Today I tried to read form data submitted via POST request. The keys are using lower and upper case letters. The request object doesn't gave me the expected result, this returned nothing:

   request.header.one('myVar')

   I created a fork on Github and fixed that bug.



   There are some other problems with the request object: The has method doesnt exist (i'm using __contains___ now), but this also use .lower() to get the value from the dictionary. Now, either the add method should use .lower() as well, or we should remove all those .lower() when accessing the dictionary.

   What was the idea of using .lower() here? Have the keys to be case insensitive? Is there a standard which defines that?


   Thanks
   falstaff

   ------------------------------__------------------------------__----

   This message was sent using IMP, the Internet Messaging Program.

   --
   You received this message because you are subscribed to the Google Groups "aspen-users" group.
   To post to this group, send email to aspen...@googlegroups.com <mailto:aspen-users@googlegroups.com>.
   To unsubscribe from this group, send email to aspen-users+unsubscribe@__googlegroups.com <mailto:aspen-users%2Bunsu...@googlegroups.com>.
   For more options, visit this group at http://groups.google.com/__group/aspen-users?hl=en <http://groups.google.com/group/aspen-users?hl=en>.




Reply all
Reply to author
Forward
0 new messages