Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-8572

Incorrectly parsed ETag when contains 'W/' as part of the content

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.4.4, 3.3.11
    • 3.5.0, 3.3.12, 3.4.5
    • JAX-RS
    • None
    • Servlet filter in Websphere Liberty 20.0.0.3 with JAX-RS.

    • Unknown

    Description

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

      Attachments

        Issue Links

          Activity

            People

              reta Andriy Redko
              ind1go Ben Cox
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: