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

Failure to parse multiple comma separated links in an HTTP Link header on a Jaxrs Response object

    XMLWordPrintableJSON

    Details

      Description

      Blocker: Specification violation resulting in RuntimeException

      Dear Apache Contributors,

      Recently I authored a pull request for OpenLiberty, which was then created by https://github.com/WhiteCat22.

       

      Original issue:
      https://github.com/OpenLiberty/open-liberty/issues/8863

       

      Original PR:
      https://github.com/OpenLiberty/open-liberty/pull/8956

      Description

      If a server returns HTTP link headers, it may do so with responding multiple link headers, or just one link header with comma separated fields.

      CXF only  recognizes multiple link headers. If only one link header with multiple values was supplied, it will throw an unexpected RuntimeException: 

      java.lang.IllegalArgumentException: Illegal character in query at index n: (Link header here)
      Caused by: java.net.URISyntaxException: Illegal character in query at index

      Examples

      Working Response:

      HTTP/1.1
      Link: <http://localhost/api/endpoint?offset=0&sysparm_limit=5>;rel="first"
      Link: <http://localhost/api/endpoint?offset=5&sysparm_limit=5>;rel="next"
      Link: <http://localhost/api/endpoint?offset=45&sysparm_limit=5>;rel="last"

      Not working response:

      HTTP/1.1
      Link: <http://localhost/api/endpoint?offset=0&sysparm_limit=5>;rel="first",<http://localhost/api/endpoint?offset=5&sysparm_limit=5>;rel="next",<http://localhost/api/endpoint?offset=45&sysparm_limit=5>;rel="last"

      That should have worked, though.

       

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                bmarwell Benjamin Marwell
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m