Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-6302

JAXRS endpoints with URL encoded addresses can not be located

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.0.3
    • 3.1, 2.7.16, 3.0.5
    • JAX-RS
    • None
    • Unknown

    Description

      I use url "/Test%20Test/Test%20Test" that define while create server via JAXRSServerFactoryBean. And I have error "No service was found." for my URL.

      I found that class org.apache.cxf.transport.http.DestinationRegistryImpl has decoding logic for SOAP requests, but Restful requests skip this logic. Please, chec checkRestfulRequest method in this class. Thsi method doesn't use decodedDestinations map for search.

      DestinationRegistryImpl.java
            for (String path : getDestinationsPaths()) {
                  String thePath = path.length() > 1 && path.endsWith(SLASH) 
                      ? path.substring(0, path.length() - 1) : path;
                  if ((address.equals(thePath) 
                      || SLASH.equals(thePath)
                      || (address.length() &gr; thePath.length() 
                          && address.startsWith(thePath) && address.charAt(thePath.length()) == '/'))
                      && thePath.length() &gr; len) {
                      ret = getDestinationForPath(path);
                      len = path.length();
                  }
              }
      

      The thePath variable contains "/Test Test/Test Test", but i registered my service with URL "/Test%20Test/Test%20Test", so equals is false.

      Please, could you fix this issue. It is critical for us, because our URL can contains whitespaces.

      Thank you.

      Attachments

        Activity

          People

            sergey_beryozkin Sergey Beryozkin
            mkamalov Marat Kamalov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 4h
                4h
                Remaining:
                Remaining Estimate - 4h
                4h
                Logged:
                Time Spent - Not Specified
                Not Specified