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

    XMLWordPrintable

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

      Attachments

        Activity

          People

            dp@ez.no dp@ez.no
            dp@ez.no dp@ez.no
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: