src/AbstractSapiEmitter.php
/**
     * Emit response headers.
     *
     * Loops through each header, emitting each; if the header value
     * is an array with multiple values, ensures that each is sent
     * in such a way as to create aggregate headers (instead of replace
     * the previous).
     *
     * @param \Psr\Http\Message\ResponseInterface $response
     *
     * @return void
     */
Emit response headers.
Loops through each header, emitting each; if the header value
is an array with multiple values, ensures that each is sent
in such a way as to create aggregate headers (instead of replace
the previous).



@return void
Emit response headers . Loops through each header emitting each ; if the header value is an array with multiple values ensures that each is sent in such a way as to create aggregate headers ( instead of replace the previous ) . @return void
protected function emitHeaders(ResponseInterface $response): void
    {
        $statusCode = $response->getStatusCode();
        foreach ($response->getHeaders() as $header => $values) {
            $name  = $this->toWordCase($header);
            $first = $name !== 'Set-Cookie';
            foreach ($values as $value) {
                header(
                    \sprintf(
                    '%s: %s',
                        $name,
                        $value
                    ),
                    $first,
                    $statusCode
                );
                $first = false;
            }
        }
    }
protected function emitHeaders ( ResponseInterface $ response ) : void { $ statusCode = $ response -> getStatusCode ( ) ; foreach ( $ response -> getHeaders ( ) as $ header => $ values ) { $ name = $ this -> toWordCase ( $ header ) ; $ first = $ name !== 'Set-Cookie' ; foreach ( $ values as $ value ) { header ( \ sprintf ( '%s: %s' , $ name , $ value ) , $ first , $ statusCode ) ; $ first = false ; } } }
Emit response headers.
Emit response headers .