/** * Update configuration for a content negotiation whitelist for a named controller service * * @param string $controllerService * @param string $headerType * @param array $whitelist * @return true * @throws PatchException */ public function updateContentNegotiationWhitelist($controllerService, $headerType, array $whitelist) { if (!in_array($headerType, ['accept', 'content_type'])) { /** @todo define exception in Rpc namespace */ throw new PatchException('Invalid content negotiation whitelist type provided', 422); } $headerType .= '_whitelist'; $config = $this->configResource->fetch(true); $config['zf-content-negotiation'][$headerType][$controllerService] = $whitelist; $this->configResource->overwrite($config); return true; }