Uploaded image for project: 'HttpComponents HttpClient'
  1. HttpComponents HttpClient
  2. HTTPCLIENT-1195

URIBuilder-created query strings are double-escaped

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 4.2 Final
    • 4.2.1
    • HttpClient (classic)
    • None
    • java version "1.6.0_24"
      OpenJDK Runtime Environment (IcedTea6 1.11.1) (6b24-1.11.1-4ubuntu3)
      OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)

    Description

      When setting parameters in URIBuilder, the keys and values are double-escaped: once in URIBuilder.build(), and again in URI.appendSchemeSpecificPart(). Example:

      URIBuilder ub = new URIBuilder("http://www.google.com/");
      ub.addParameter("foo=bar", "baz&qux");
      ub.build(); // http://www.google.com/?foo%253Dbar=baz%2526qux

      In order to avoid this problem, URIBuilder.build() should use URI's one-argument constructor, which does not try to do extra escaping.

      Attachments

        1. HTTPCLIENT-1195-2.patch
          6 kB
          Sebb
        2. HTTPCLIENT-1195.patch
          3 kB
          Sebb

        Issue Links

          Activity

            People

              Unassigned Unassigned
              cky Chris K. Jester-Young
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: