jersey
  1. jersey
  2. JERSEY-1341

Problem using JerseyClient to sent a empty string parameter

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 1.12
    • Fix Version/s: 2.0-m07, 2.0
    • Component/s: core
    • Labels:
      None
    • Environment:

      Jersey 1.12

      Description

      Hey guys,

      I have an issue when I try to sent a empty string using jersey-client
      lib, when jersey generate the request strip the = sign when the value
      is an empty string.

      For example:
      Jersey generate something like (value is the empty string, the equals
      is lost and I get a 500 error):
      http://myservice.test.com/services/rest/setAttribute?id=555&value&test=test

      If I go to the browser an enter (this one works!!!):
      http://myservice.test.com/services/rest/setAttribute?id=555&value=&test=test

      I did a quick research in your code and seems that I get the line that
      is causing the bug. Also, I read something about this on
      http://tools.ietf.org/html/rfc3986#section-3.4 the equals is not optional it should be there.

      The bug is in jersey-core 1.13, line 480 (it should be >= instead of >)
      if (stringValue.length() > 0)

      { query.append('=').append(encode(stringValue, UriComponent.Type.QUERY_PARAM)); }

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Martin Matula
            Reporter:
            rblanco.cr
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: