Uploaded image for project: 'COmanage'
  1. COmanage
  2. CO-2200

Error if "Accept" header set in Match API request

    XMLWordPrintable

Details

    Description

      If the header "Accept: application/json" is set in a Match API request, the server returns a 500 error with the following stack trace:

      2021-09-04 01:04:52 Error: [Cake\View\Exception\MissingTemplateException] Template file "TierApi/json/response.ctp" is missing.
      #0 /opt/comanage/match-develop/app/vendor/cakephp/cakephp/src/View/SerializedView.php(104): Cake\View\View->_getViewFileName('TierApi/json/re...')
      #1 /opt/comanage/match-develop/app/vendor/cakephp/cakephp/src/View/JsonView.php(107): Cake\View\SerializedView->render('response', NULL)
      #2 /opt/comanage/match-develop/app/vendor/cakephp/cakephp/src/Controller/Controller.php(796): Cake\View\JsonView->render('response', NULL)
      #3 /opt/comanage/match-develop/app/src/Controller/TierApiController.php(415): Cake\Controller\Controller->render('response')
      #4 /opt/comanage/match-develop/app/src/Controller/TierApiController.php(671): App\Controller\TierApiController->doMatchRequest(true)
      #5 /opt/comanage/match-develop/app/vendor/cakephp/cakephp/src/Controller/Controller.php(610): App\Controller\TierApiController->search()
      #6 /opt/comanage/match-develop/app/vendor/cakephp/cakephp/src/Http/ActionDispatcher.php(120): Cake\Controller\Controller->invokeAction()
      #7 /opt/comanage/match-develop/app/vendor/cakephp/cakephp/src/Http/ActionDispatcher.php(94): Cake\Http\ActionDispatcher->_invoke(Object(App\Controller\TierApiController))

      (etc. ...)

      (Copying TierApi/response.ctp to TierApi/json/response.ctp does fix the problem, as does removing the header.)

       

      Attachments

        Activity

          People

            benn.oshrin@at.internet2.edu Benn Oshrin (internet2.edu)
            allan.kim@at.internet2.edu Allan Kim
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: