title: Resource interpreted as Image but transferred with MIME type text/html, curl, php
body: <p>I'm getting this error which i haven't seen before. I'm using cURL to try and get a captcha image from my site, but im getting this error instead of the image i want.</p>
  
  <pre><code>if(isset($_GET['captcha'])) {
   $curl-&gt;open("GET","https://mydomain.com");
   $curl-&gt;exec();
  
   preg_match('/_mobile_sess=[^;]+/', $curl-&gt;getHeaders(), $sess);
   $_SESSION['cookie'] = $sess[0]; 
  
   preg_match('/ame="authenticity_token" type=\"hidden\" value=\"(.+?)\"/i',$curl-&gt;responseText, $tkn);
  
   $_SESSION['token'] = $tkn[1];
   preg_match('/\/signup\/captcha\/([0-9-a-z]+)\.gif/i', $curl-&gt;responseText, $cs);
   $_SESSION['captchaUrl'] = $cs[1];
  
   $curl-&gt;open("GET", "http://mydomain.com" . $cs[0]);
   $curl-&gt;cookie = $_SESSION['cookie'];
   $curl-&gt;exec();
   echo $curl-&gt;responseText;
  
   die;
  </code></pre>
  
  <p>}</p>
  
  <p>I've set the MIME type as <code>&lt;meta http-equiv="Content-Type" content="image/gif"&gt;</code> in my head of my HTML doc but still get the same issue.</p>
  
  <p>This is the form where i'm trying to output the image.</p>
  
  <pre><code>if(empty($_SERVER['QUERY_STRING'])){
    echo "&lt;center&gt;&lt;form method='POST' action='?go'&gt;
    &lt;input  type='hidden' name='nameC' value='- SAFAL -' &gt;&lt;br/&gt;
    &lt;b&gt;User Name&lt;/b&gt;&lt;br&gt;&lt;input name='login' size='30' id='login'    value='safal".rand(111111,9999999)."'&gt;&lt;br/&gt;
   &lt;b&gt;Password&lt;/b&gt;&lt;br&gt;&lt;input name='senha' id='senha' size='30' value='".rand()."'&gt;&lt;br/&gt;  &lt;br&gt;
   &lt;img src='?captcha'&gt;&lt;br/&gt;
   &lt;input name='cs' id='cs' placeholder='Put The Capcha' size='20'  onclick='if(this.value==\"Digite aqui\") this.value=\"\"'&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;
   &lt;input type='submit' value='Click Here' id='btn'&gt;
   &lt;/form&gt;";
  }
  </code></pre>