How change or add a header to the response in Zend Expressive 2 (with HtmlResponse) ?
class NotModifiedMiddleware implements ServerMiddlewareInterface
{
/**
* Process an incoming server request and return a response, optionally delegating
* to the next middleware component to create the response.
*
* @param ServerRequestInterface $request
* @param DelegateInterface $delegate
*
* @return ResponseInterface
*/
public function process(ServerRequestInterface $request, DelegateInterface $delegate)
{
}
}
HtmlResponse, recieves as a third param an array of headers to use at initialization.
As an example: