public function toSymfonyResponse() {
    $headers = array_merge(
      array('Content-Type' => Constants::MIME_TYPE),
      $this->getHeaders()
    );
    return new \Symfony\Component\HttpFoundation\Response(
      $this->encode(),
      $this->code,
      $headers
    );
  }