title: downloading an image with angular's $http from amazon's s3 return bad request(400)
body: <p>I'm writing an angularjs 1.5.0 application.</p>
  
  <p>In this application i need to use <code>$http</code> to fetch image data to a blob.</p>
  
  <p>i used the following code in my angular js controller:</p>
  
  <pre><code>$http({
              url : 'https://myalcoholist-tuxin-com.s3.amazonaws.com/my-images/thumb_0000000001.jpg',
              method : 'GET',
              params : {},
              headers : {
                  'Content-Type' : undefined,
              },
              responseType: "blob"
          }).success(function(data, status, headers, config) {
          }).error(function(data, status, headers, config) {
  
          });
  </code></pre>
  
  <p>my website is at <a href="https://myalcoholist.com" rel="nofollow">https://myalcoholist.com</a></p>
  
  <p>I enabled cors in my s3 bucket using Bucket Explorer with the following parameters:</p>
  
  <pre><code>AllowedOrigin https://myalcoholist.com
  AllowedHeader *
  AllowedMethod GET
  </code></pre>
  
  <p>before settings the cors , i would get a preflight request error. after enabling cors I get </p>
  
  <pre><code>GET https://myalcoholist-tuxin-com.s3.amazonaws.com/my-images/thumb_0000000001.jpg 400 (Bad Request)
  </code></pre>
  
  <p>the pre-flight request, the OPTIONS method is sent and succeeds.</p>
  
  <pre><code>Request URL:https://myalcoholist-tuxin-com.s3.amazonaws.com/my-images/thumb_0000000001.jpg
  Request Method:OPTIONS
  Status Code:200 OK
  Remote Address:54.231.114.146:443
  </code></pre>
  
  <p>but then the GET Request fails. </p>
  
  <p>I tried to put an image on <a href="https://myalcoholist.com" rel="nofollow">https://myalcoholist.com</a> and then to try to get it with $http request and I got no errors. it seems that only trying to download from amazon's s3 is causing problems and I have no idea why!</p>
  
  <p>the ACL is set for read. and browsing that file in the browser works.</p>
  
  <p>any information regarding the issue would be greatly appreciated.</p>