apioo / fusio

Open source API management platform

Home Page:https://www.fusio-project.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Util-Chain and PHP-Sandbox (Custom Headers)

vincenzo84 opened this issue · comments

In a PHP-Sandbox action that is called within a Util-Chain, how do I add a header that is available in all responses in the chain?

Thank you

Found it, just add this:

$requestContext = $request->getContext();
$httpRequest = $requestContext->getRequest();
$headers = $httpRequest->getHeaders();
$httpRequest->addHeader('key', 'value');

Thank you