AssetCompress\Middleware\AssetCompressMiddleware::respond PHP Method

respond() protected method

Respond with the asset.
protected respond ( Psr\Http\Message\ResponseInterface $response, string $contents, AssetTarget $build ) : Psr\Http\Message\ResponseInterface
$response Psr\Http\Message\ResponseInterface The response to augment
$contents string The asset contents.
$build MiniAsset\AssetTarget The build target.
return Psr\Http\Message\ResponseInterface
    protected function respond($response, $contents, $build)
    {
        // Deliver built asset.
        $body = $response->getBody();
        $body->write($contents);
        $body->rewind();
        return $response->withHeader('Content-Type', $this->mapType($build));
    }