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

getting 405 instead of 404 for unmatched pathparam

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Invalid
    • 3.1.2
    • NeedMoreInfo
    • JAX-RS
    • None
    • Unknown

    Description

      @Component
      @Path("/files")
      public class FilesService{

      @AutoWired
      private FileGetService fileGetService;

      @POST
      @Path("/v1.0")
      public void saveFile(final InputStream inputFile)

      { //some logic }

      @Path("/

      {fileId}

      ")
      public FileGetService getFile()

      { return fileGetService; }

      }

      This class FilesService has two methods one to serve GET and other POST

      getFile() - sub-resource locator which returns a instance of FileGetService
      saveFile(..) - resource endpoint which has logic to serve the POST requests

      When a class has both sub-resource locator and a resource endpoint any request with wrong pathparam is throwing 405 instead of 404.

      For Example a POST request with below URL throws 405 instead of 404.
      http://localhost:8080/context/files/v2.0

      Ideally it should have thrown 404 as path param is v2.0 instead of v1.0.

      Attachments

        Activity

          People

            Unassigned Unassigned
            nburuzul naresh buruzula
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: