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

Implementations of RestProducerFactory should handle empty or null basePath and uriTemplate

    XMLWordPrintableJSON

Details

    • Unknown

    Description

      All RestProducerFactory implementations use code similar to:

      String url;
      if (uriTemplate != null) {
          // http is already prefixed in base path
          url = String.format("%s/%s/%s", host, basePath, uriTemplate);
      } else {
          // http is already prefixed in base path
          url = String.format("%s/%s", host, basePath);
      }
      

      This fails to account for basePath being null or empty, and uriTemplate being empty, which results in the resulting url to either have double slashes (e.g. http://host//uriTemplate) or "null" String in url (e.g. http://host/null/uriTemplate).

      Attachments

        Activity

          People

            zregvart Zoran Regvart
            zregvart Zoran Regvart
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: