jsr339-experts@jax-rs-spec.java.net

[jsr339-experts] Re: [jax-rs-spec users] Support for case-insensitive URI parameters ?

From: Sergey Beryozkin <sberyozkin_at_talend.com>
Date: Fri, 4 Oct 2013 15:41:22 +0100

Hi Santiago,

thanks for the comments,
On 04/10/13 14:51, Santiago Pericas-Geertsen wrote:
> Sergey,
>
> The HTTP RFC clearly states that header field names are case
> insensitive. It also has a section about URI comparison, where it says
> that, modulo some exceptions [1], URI comparison is case sensitive.
> Unlikely as it may be, someone could have built a system where both
> "foo" and "FOO" are used as matrix params, right?
>
Right. I agree there is a reason JAX-RS does not do it by default.
I guess though that many (quite a few) applications may be quite happy
to treat such params in a case-insensitive way, hence I suggested an
optional support as another option.

Apart from adding specific methods at UriInfo level

1. Add an optional property "caseInsensitive" (default 'false') to
QueryParam & MatrixParam annotations
2. Add CaseInsensitive annotation

I agree the above will not worth it if we need to keep it very strict re
supporting the relevant HTTP text, but given JAX-RS makes so many things
simple for developers, may be it can help here a bit too, example, so
that users can comment at

http://stackoverflow.com/questions/16979859/case-insensitive-query-string-request-paramters

"but you know, you can it make it so easy with JAX-RS" :-)

Sergey

> -- Santiago
>
> [1] http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.2.3
>
> On Oct 4, 2013, at 9:24 AM, Sergey Beryozkin <sberyozkin_at_talend.com
> <mailto:sberyozkin_at_talend.com>> wrote:
>
>> Hi
>>
>> I've got a question from my colleague re supporting case insensitive
>> URI parameters.
>>
>> I don't see anything in the API regarding it so I assume it is all
>> case-sensitive (PathParam, QueryParam, and MatrixParam), except for
>> HeaderParam.
>>
>> I guess it is technically correct. But IMHO it makes sense to relax it
>> at least for QueryParam and MatrixParam given that they do not affect
>> the matching algorithm, and would simplify it all for the code dealing
>> with the query/matrix params. At the very list this may be can be done
>> optionally, example, UriInfo can have getters for query and matrix
>> param maps with a 'case-sensitive' flag
>>
>> Will I open a minor enhancement request ?
>>
>> Thanks, Sergey
>>
>>
>>
>>
>>
>