private function respond($response, $contents, $ext) { // Deliver built asset. $body = $response->getBody(); $body->write($contents); $body->rewind(); return $response->withHeader('Content-Type', $this->mapType($ext)); }