perwendel/spark — pull request #61 by c089 (2013-04-11 12:22:12+00:00)
Title: Make routes case-sensitive

This fixes at least two issues, both of which we added integration tests for:
1. With a route defined using "/route/:param", when doing a request on
"/route/MyValue", request.params("param") would return the lowercased "myvalue"
2. When defining two routes "/route/:param" and "/ROUTE/:param", it would invoke
the first match even doing a request on "/ROUTE/foo"

RFC2616, Setion 3.2.3 (URI Comparison) says the following on the topic (note it
only comments on client behavior, but if a client treats two URIs as being
different, the server should adhere to this all the more):

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 "/".