title: Chrome on Windows adding trailing underscores to downloaded files?
body: <p>I've got a rather odd situation happening, that I'm having difficulty tracking down in an existing Django application.  One of the views, which inherits from APIView, returns with a file when a user makes a POST call.  The endpoint works fine, but there's something odd happening when the downloaded file reaches the client machine.  By the time the browser receives the file, the file extension has been renamed with a trailing underscore.  (So suppose the file was originally "test.txt", the version that the client receives would be "test.txt_").  </p>
  
  <p>As near as I can figure, just before the response object is returned in the APIView, the content-type and content-disposition headers look correct.  E.g.:</p>
  
  <pre><code>Content-Type: application/octet-stream
  Content-Disposition: attachment;filename="test.txt"
  </code></pre>
  
  <p>That same file, when it shows up in Chrome downloads, is named "test.txt_" - with the trailing underscore.  I've tried the same thing out in Firefox, and it seems to download correctly.  Unfortunately, telling the majority of our users to switch browsers isn't going to fly.</p>
  
  <p>I have tried:</p>
  
  <ul>
  <li>Forcing a different content type (e.g.: instead of "application/octet-stream", try "application/text", just to see what happens).  This had no effect.</li>
  <li>Formatting the content disposition slightly different (e.g.: space between the semicolon and filename).  This also had no effect.</li>
  <li>Removed the double quotes around the filename in the content-disposition header.  No effect.</li>
  <li>Dropping breakpoints within the Rest Framework itself, but Visual Studio Code doesn't seem to trigger on these.  (I'm not super-familiar with debugging through Visual Studio Code, so this may be my fault).</li>
  <li>Stripped out any custom middleware, so the only remaining middleware are as follows:</li>
  </ul>
  
  <pre><code>corsheaders.middleware.CorsMiddleware
  django.contrib.sessions.middleware.SessionMiddleware
  django.middleware.locale.LocaleMiddleware
  django.middleware.common.CommonMiddleware
  django.middleware.csrf.CsrfViewMiddleware
  django.contrib.auth.middleware.AuthenticationMiddleware
  django.contrib.messages.middleware.MessageMiddleware
  </code></pre>
  
  <p>So far, any similar issues that other people have experienced seem to be slightly different (i.e.: Internet Explorer removing the period in the extension and replacing it with an underscore).</p>
  
  <p>Any guesses on what might be happening here?  I'm a bit stumped.  </p>