[Dancer-users] case insensitive param keys

Flavio Poletti polettix at gmail.com
Thu Oct 7 17:20:20 CEST 2010

This kind of normalisation is discouraged by the standard - I'm referring
to http://tools.ietf.org/html/rfc2616#section-3.2.3 - because of the SHOULD:

--- cut here ---
   When comparing two URIs to decide if they match or not, a client
   SHOULD use a case-sensitive octet-by-octet comparison of the entire
   URIs, with these exceptions:

      - A port that is empty or not given is equivalent to the default
        port for that URI-reference;

        - Comparisons of host names MUST be case-insensitive;

        - Comparisons of scheme names MUST be case-insensitive;

        - An empty abs_path is equivalent to an abs_path of "/".

   Characters other than those in the "reserved" and "unsafe" sets (see
   RFC 2396 [42]) are equivalent to their ""%" HEX HEX" encoding.

   For example, the following three URIs are equivalent:

--- cut here ---

It does not include the query part in the exceptions, hence I think that the
case... SHOULD be preserved.



On Wed, Oct 6, 2010 at 4:14 PM, Mike Schroeder <mike at donor.com> wrote:

> When Dancer::Request::_parse_get_params() parses the QUERY_STRING (as I
> assume the post body), it leaves the key names in whatever case they come in
> as.  I checked some RFCs (http://tools.ietf.org/html/rfc3986#section-6.2.3)
> to see if there was anything definitive, but not really that I could find.
> From a pragmatic perspective, it would be nice to have the keys forced to
> lowercase by Dancer::Request.  If you control every link to your
> application, then you can do this yourself, but if you have links coming in
> from external sites, and someone chooses to link to your site as
>  http://www.example.com/?MyPaRAM=Whatever
> then simple code in Dancer expecting to see params->{myparam} will silently
> fail.  Is this intentional behavior that I need to code around in my app, or
> something that could be fixed in Dancer::Request?
> Thanks in advance,
> Mike.
> PS: Does anyone know of a good way to search the archives for this list
> other than using a site: param on google?
> _______________________________________________
> Dancer-users mailing list
> Dancer-users at perldancer.org
> http://www.backup-manager.org/cgi-bin/listinfo/dancer-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.backup-manager.org/pipermail/dancer-users/attachments/20101007/6ebab8be/attachment.htm>

More information about the Dancer-users mailing list