Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-19113

You get a 404 instead of a 405 when accessing a resource with a not-supported HTTP method

    Details

      Description

      If you specifically declare http methods when defining the routes, you'll incorrectly get a 404 instead of a 405 if using invalid http methods.
      Like this

      new ezpRestVersionedRoute( new ezpMvcRailsRoute( '/content/types/:typeId', 'ezx\\RestApi\\Controller
      ContentType', 'load', array(), 'http-get' ), 1 ),
      new ezpRestVersionedRoute( new ezpMvcRailsRoute( '/content/types/:typeId', 'ezx\\RestApi\\Controller
      ContentType', 'load', array(), 'http-put' ), 1 ),

      You'll get a 404 if accessing the resource defined above with for instance a POST request

      FYI :
      If you don't provide the 5th paramater ('http-get') but instead uses the supportedProtocols property, then you'll correctly get a 405

      This bug is an result of EZPNEXT-177

        Activity

        Show
        Damien Pobel (eZ) added a comment - Fixed in ezpublish master https://github.com/ezsystems/ezpublish/commit/4fc102d635e2a33f40d939715fa8bf674e8e8e19 Implemented in ezprestapiprovider https://github.com/ezsystems/ezprestapiprovider/commit/078a358461317b0a22fb5f49663acfebeddf827f

          People

          • Assignee:
            Damien Pobel (eZ)
            Reporter:
            Damien Pobel (eZ)
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: