diff --git a/guide/index.rst b/guide/index.rst index 12fb7e2..0e0266b 100644 --- a/guide/index.rst +++ b/guide/index.rst @@ -1006,6 +1006,7 @@ Response Config Options 'csp' => [], 'csp_report_only' => [], 'json_flags' => null, + 'replace_headers' => false, 'request_instance' => 'default', ], ], @@ -1065,6 +1066,11 @@ json_flags Flags for ``json_encode``. The default is set to none. +replace_headers +""""""""""""""" + +Set ``true`` to force header replacement. Default is ``false`` to not replace. + request_instance """""""""""""""" diff --git a/src/App.php b/src/App.php index 6845409..d597093 100644 --- a/src/App.php +++ b/src/App.php @@ -1256,6 +1256,9 @@ protected static function setResponse(string $instance) : Response if (isset($config['json_flags'])) { $service->setJsonFlags($config['json_flags']); } + if (isset($config['replace_headers'])) { + $service->setReplaceHeaders($config['replace_headers']); + } return static::setService('response', $service, $instance); } diff --git a/tests/configs/response.config.php b/tests/configs/response.config.php index 629beac..43d0ee3 100644 --- a/tests/configs/response.config.php +++ b/tests/configs/response.config.php @@ -39,6 +39,7 @@ ], ], 'json_flags' => \JSON_THROW_ON_ERROR, + 'replace_headers' => false, 'request_instance' => 'default', ], ];