title: How to set Content-Type of Supertest attachment
body: <p>I came across a problem in my app that the <code>Content-Type</code> associated with an uploaded file was wrong if the file was sent from Microsoft Windows, giving <code>application/octet-stream</code>, while it was okay if sent from Mac, giving <code>text/csv</code>. After fixing my code to not rely on the mime type from the request, I would like to simulate that condition in one of my tests.</p>
  
  <p>Given the following request, that includes JSON-stringified form fields and a file attachment, <a href="https://github.com/visionmedia/supertest" rel="nofollow noreferrer">using supertest</a>:</p>
  
  <pre><code>  request(app)
      .post('/some/where')
      .field('someFormData', JSON.stringify(formData))
      .attach('someFile', 'someFile.csv')
      .expect(400)
      .end(done);
  </code></pre>
  
  <p>How can I change the <strong>Content-Type</strong> for the attached file? Looking at Edge's Network tab, I would like to see the following for the request above:</p>
  
  <pre><code>-----------------------------7e13121340602
  Content-Disposition: form-data; name="someFormData"
  
  {.............}
  -----------------------------7e13121340602
  Content-Disposition: form-data; name="someFile"; filename="someFile.csv"
  Content-Type: application/octet-stream
  
  ÿØÿà
  </code></pre>
  
  <p>(The JSON string has been omitted with dots)</p>
  
  <p>(Instead of showing <code>text/csv</code>, I want to simulate the wrong content type.)</p>