You are here

public function CaptchaImageResponse::sendHeaders in CAPTCHA 8

File

image_captcha/src/Response/CaptchaImageResponse.php, line 95

Class

CaptchaImageResponse
Response which is returned as the captcha for image_captcha.

Namespace

Drupal\image_captcha\Response

Code

public function sendHeaders() {
  if ($this->config
    ->get('image_captcha_file_format') == IMAGE_CAPTCHA_FILE_FORMAT_JPG) {
    $this->headers
      ->set('content-type', 'image/jpeg');
  }
  else {
    $this->headers
      ->set('content-type', 'image/png');
  }
  return parent::sendHeaders();
}