Since RFC 953 specifies that no distinction may be made between upper and
lower case letters, and RFC 2616 sec 5.2 says that invalid headers should be
ignored, I am curious if it wouldn't make more sense to validate for ASCII
characters and then lowercase the host header part before attempting to
match the regex and/or imply that the particular regex is case insensitive.
As long as it doesn't mean special casing for the host header I think that
would be a more robust solution.

Thoughts?

Ryan

On Sun, Aug 8, 2010 at 10:37 AM, C. Mundi <[email protected]> wrote:

> Thanks for the pointer!
>
>
> On 8/8/10, Alvaro Lopez Ortega <[email protected]> wrote:
> > On 08/08/2010, at 16:11, C. Mundi wrote:
> >
> >> I missed that in the docs too.  Where is it?  I suspect the same
> >> section has more information I should know.  :)
> >
> > It is on PCRE's documentation (the library Cherokee uses to compile and
> > evaluate regular expressions). It'd be good to add this tip to the
> > Cherokee's documentation though. I suppose many more people hit this same
> > problem before.
> >
> > Cheers,
> >
> >> On 8/8/10, Alvaro Lopez Ortega <[email protected]> wrote:
> >>> On 07/08/2010, at 22:47, Peter-Paul van Gemerden wrote:
> >>>
> >>>> I was wondering whether it's possible to have case-insensitive host
> >>>> matching. I ask because I've run into a browser that doesn't convert
> the
> >>>> FQDN to lowercase before sending the request: Android's built-in
> >>>> browser.
> >>>>
> >>>> The case is this: I have a client whose business name contains
> capitals,
> >>>> whose website is marketed as such (e.g. ClientBizzName.com) and whose
> >>>> clients/visitors are known a) to use mobile devices and b) to be
> >>>> complete
> >>>> morons :P (pardon my language). I don't 100% trust them to use all
> lower
> >>>> case or capitals in the right spots, not even on a mobile device.
> >>>>
> >>>> So, does anyone know if there is something like a flag for the regex
> >>>> host
> >>>> matching?
> >>>
> >>> Yeah, you have to precede the regular expression by (?i). That will
> >>> perform
> >>> a case-insensitive evaluation.
> >>
> >
> > --
> > Octality
> > http://www.octality.com/
> >
> >
> _______________________________________________
> Cherokee mailing list
> [email protected]
> http://lists.octality.com/listinfo/cherokee
>
_______________________________________________
Cherokee mailing list
[email protected]
http://lists.octality.com/listinfo/cherokee

Reply via email to