From fe44bc372c5a6eb2cf793cf0a9da24bd0d2ef0e9 Mon Sep 17 00:00:00 2001 From: "Joseph P. White" Date: Thu, 19 Mar 2020 10:28:21 -0400 Subject: [PATCH] Remove unnecessary redirect in the job viewer rest stack. The job viewer rest api has an unusual code path to get the list of jobs for a given saved search. There is a 302 redirect when the interface gets the list of jobs. There is no 302 redirect for any of the other equivalent queries (such as list of information for a job). All of the required information to respond to the request is in the original request. This pull request removes the redirect. The path that wasa being redirected to still remains so as to not break compatibility with any external systems (they both call the same underlying function). --- .../Controllers/WarehouseControllerProvider.php | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/classes/Rest/Controllers/WarehouseControllerProvider.php b/classes/Rest/Controllers/WarehouseControllerProvider.php index bc15aa14c4..553c567e15 100644 --- a/classes/Rest/Controllers/WarehouseControllerProvider.php +++ b/classes/Rest/Controllers/WarehouseControllerProvider.php @@ -361,7 +361,7 @@ public function searchHistory(Request $request, Application $app) } elseif ($jobId !== null && $recordId !== null && $realm !== null) { $result = $this->processJobByJobId($app, $user, $realm, $jobId, $action); } elseif ($recordId !== null && $realm !== null) { - $result = $this->processHistoryRecordRequest($request, $app, $user, $recordId, $action); + $result = $this->getHistoryById($request, $app, $recordId); } elseif ($realm !== null && $title !== null) { $result = $this->getHistoryByTitle($request, $app, $realm, $title); } elseif ($realm !== null) { @@ -1716,20 +1716,6 @@ private function processJobByJobId( ); } - /** - * @param Request $request - * @param Application $app - * @param XDUser $user - * @param int $recordId - * @param string $action - * @return \Symfony\Component\HttpFoundation\JsonResponse - */ - private function processHistoryRecordRequest(Request $request, Application $app, XDUser $user, $recordId, $action) - { - $url = $request->getBasePath() . $request->getPathInfo() . "/$recordId?".$request->getQueryString(); - return $app->redirect($url); - } - /** * @param Application $app * @param XDUser $user