/** * Handle JMAP client requests */ public function process(Request $request, Response $response) { switch ($request->getMethod()) { case 'POST': $this->processPOST($request, $response); break; default: throw new ProcessorException(405, "Method " . $request->getMethod() . " not allowed"); } if ($response->getStatus() === 401) { $response->setHeader('WWW-Authenticate', Auth::SCHEME); } }