Ben Cox created CXF-8572:
----------------------------

             Summary: Incorrectly parsed ETag when contains 'W/' as part of the 
content
                 Key: CXF-8572
                 URL: https://issues.apache.org/jira/browse/CXF-8572
             Project: CXF
          Issue Type: Bug
          Components: JAX-RS
         Environment: Servlet filter in Websphere Liberty 20.0.0.3 with JAX-RS.
            Reporter: Ben Cox


We have the following ETag being generated:
wyoBLW/ye71RgN/0LNyj4eA5rfE1ovtlM03aakuGr2Y=
You'll note in characters 6-7, the combination {{W/}} is found.

When we run {{EntityTag.valueOf(etag)}} using this Etag, this results in the 
following error:
java.lang.IllegalArgumentException: Misformatted ETag : 
"wyoBLW/ye71RgN/0LNyj4eA5rfE1ovtlM03aakuGr2Y="
        at 
org.apache.cxf.jaxrs.impl.EntityTagHeaderProvider.fromString(EntityTagHeaderProvider.java:57)
The problem [in the 
code|[http://example.com|https://github.com/apache/cxf/blob/097e6bf31f3341ec3fc0a08cfd1f6b65a5e97b1e/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/EntityTagHeaderProvider.java#L42]]
 seems to be that it accepts {{W/}} as a special combination regardless of 
position, which doesn't match with the spec as I read it.

Setting this minor because in our case I can change a little bit of 
documentation and alter the ETag; however, it could be a larger problem for 
anyone who is dealing with purely computer-generated tags and can't get away 
from a tag with {{W/}} in it.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to