Uploaded image for project: 'Spring Integration'
  1. Spring Integration
  2. INT-2455

Spring Integration Http's HttpRequestExecutingMessageHandler and URI encoding

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Complete
    • Affects Version/s: 2.2.1
    • Fix Version/s: 3.0 M2
    • Component/s: HTTP Support
    • Labels:

      Description

      I'm trying to configure an http outbound-channel-adapter that performs a GET operation to URL "http://localhost/service?parameter=%2bsomething":

      <int-http:outbound-channel-adapter id="httpAdapter"
      url="http://localhost/service?parameter=%2bsomething
      channel="httpOutChannel"
      http-method="GET"
      expected-response-type="java.lang.String" />

      The url encoded '' character %2b gets encoded twice, and the server receives the parameter as "%252bsomething". If I exchange %2b with unencoded character '', it gets passed to the request as such ("/service?parameter=something") as '' is a valid URL character. The problem seems to be with HttpRequestExecutingMessageHandler passing the URI as a String to RestTemplate.exchange(), which only encodes characters that are not valid URL characters. RestTemplate URI encoding is discussed in issue
      SPR-5516.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                abilan Artem Bilan
                Reporter:
                janne@kytomaki.com janne kytömäki
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0d
                  0d
                  Logged:
                  Time Spent - 1h
                  1h