users@jersey.java.net

[Jersey] Bad If-None-Match header value

From: Farrukh Najmi <farrukh_at_wellfleetsoftware.com>
Date: Thu, 17 Nov 2011 16:53:45 -0500

Hi Guys,

I am playing with HTTP Conditional GET support in jersey (nice!) and
came across something that seems unexpected.
If the "If-None-Match" is provided unquoted then I get an error:

2 > GET http://localhost:9090/xyz
2 > if-none-match: -142345b90ecd5fe655e4a4acdaf3db5b9ebaf827
2 > accept: ...
2 > user-agent: Java/1.6.0_20
2 > host: localhost:9090
2 > connection: keep-alive
2 >

Nov 17, 2011 4:46:56 PM
com.sun.jersey.api.container.filter.LoggingFilter$Adapter finish
INFO: 2 * Server out-bound response
2 < 400
2 < Content-Type: text/plain
2 <
Bad If-None-Match header value: '-142345b90ecd5fe655e4a4acdaf3db5b9ebaf827'

If the header value is quoted all is well:

- resp = webResource.header("If-None-Match",
etag.getValue()).get(ClientResponse.class);
+ resp = webResource.header("If-None-Match", "\"" +
etag.getValue() + "\"").get(ClientResponse.class);

In the debugger I saw that there is a ParseException while parsing the
etag value.

Is this a bug?

-- 
Regards,
Farrukh Najmi
Web: http://www.wellfleetsoftware.com