Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-11671

camel-ahc - No way to disable url encoding

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.19.1
    • 2.19.3, 2.20.0
    • camel-ahc
    • None
    • Novice

    Description

      There currently seems to be now way to really disable url encoding for ahc urls with query parameters.

      I even tried to use my own ahc binding.
      The problem seems to be, that the AhcProducer uses this section:

       public boolean process(Exchange exchange, AsyncCallback callback) {
              try {
                  // AHC supports async processing
                  Request request = getEndpoint().getBinding().prepareRequest(getEndpoint(), exchange);
                  log.debug("Executing request {} ", request);
                  client.prepareRequest(request).execute(new AhcAsyncHandler(exchange, callback, request.getUrl(), getEndpoint().getBufferSize()));
                  return false;
              } catch (Exception e) {
                  exchange.setException(e);
                  callback.done(true);
                  return true;
              }
          }
      

      By calling client.prepareRequest(request) the already created request will be turned again into a request builder with enabled url encoding.
      From my perspective this makes no sense:

      1. we could already return a request builder from the AhcBinding, which would save us some processing time
      2. the settings on this request builder would then not be overriden

      But I can see this would be a breaking change in the API of the AhcBinding.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            acosentino Andrea Cosentino
            convoi Justin Heesemann
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment