Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8671145
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T18:52:40+00:00 2026-06-12T18:52:40+00:00

I set up CORS on an S3 bucket like so: <?xml version=1.0 encoding=UTF-8?> <CORSConfiguration

  • 0

I set up CORS on an S3 bucket like so:

<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
    <CORSRule>
        <AllowedOrigin>*</AllowedOrigin>
        <AllowedMethod>GET</AllowedMethod>
    </CORSRule>
</CORSConfiguration>

Here’s a screenshot of the AWS console: https://dzwonsemrish7.cloudfront.net/items/341y0o1n1X2a0O1X2s38/Screen%20Shot%202012-10-09%20at%209.59.44%20PM.png?v=2478ad83

When I point my color-thief javascript at an image hosted on the same domain, everything works as expected, but when I point to an asset in my S3 bucket, regardless of whether I run my script from localhost, lvh.me (which points to 127.0.0.1), or from the real interwebs, I get errors like this in Chrome 22:

Unable to get image data from canvas because the canvas has been tainted by cross-origin data.
Uncaught Error: SECURITY_ERR: DOM Exception 18

and this in Firefox 15:

SecurityError: The operation is insecure.

Here’s what the headers look like in the Google Chrome Network Inspector:

Request URL:https://s3.amazonaws.com/assets-zeke.heroku.com/addons-zeke.heroku.com/catalogs/58/original.png
Request Method:GET
Status Code:304 Not Modified

Request Headers
Accept:*/*
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Cache-Control:max-age=0
Connection:keep-alive
Host:s3.amazonaws.com
If-Modified-Since:Tue, 09 Oct 2012 22:52:57 GMT
If-None-Match:"6de1a52294934c5e288894b84100d99b"
Referer:http://localhost:5000/marketplace/addons/sendgrid/edit
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.79 Safari/537.4

Response Headers
HTTP/1.1 304 Not Modified
x-amz-id-2: qGvoGlvpKeSSzelanWsIPDF3zd5wQzHTr27NZoUbhNqAM1QzmKcWHnTqIkKVxF/m
x-amz-request-id: FD24FB8CA244E327
Date: Wed, 10 Oct 2012 05:20:53 GMT
Last-Modified: Tue, 09 Oct 2012 22:52:57 GMT
ETag: "6de1a52294934c5e288894b84100d99b"
Server: AmazonS3

And here’s what the headers look like after I changed the URL structure to {bucket}.s3.amazonaws.com (and removed the period)
from my bucket name.

Request URL:http://assets-zeke.s3.amazonaws.com/addons-zeke.heroku.com/catalogs/58/original.png
Request Method:GET
Status Code:200 OK
Request Headers

Request Headers
Accept:*/*
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Cache-Control:no-cache
Connection:keep-alive
Host:assets-zeke.s3.amazonaws.com
Pragma:no-cache
Referer:http://lvh.me:5000/marketplace/addons/airbrake/edit
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.79 Safari/537.4

Response Headers
Accept-Ranges:bytes
Content-Length:6696
Content-Type:image/png
Date:Wed, 10 Oct 2012 17:56:17 GMT
ETag:"6de1a52294934c5e288894b84100d99b"
Last-Modified:Wed, 10 Oct 2012 17:50:38 GMT
Server:AmazonS3
x-amz-id-2:UGVKQ9VQbJ82DLDxR53uDP0ZUMgla+e0GU5vO9yLr6MsY8wijl9KnM7fOyDlT+ta
x-amz-request-id:8A16CF1E02A0106C

Shouldn’t I be seeing Access-Control-Allow-Origin: * here? Does the 304 mean that Amazon is caching the response?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T18:52:42+00:00Added an answer on June 12, 2026 at 6:52 pm

    Request URL:https://s3.amazonaws.com/assets-zeke.heroku.com/addons-zeke.heroku.com/catalogs/58/original.png

    Well, there’s your problem. Because of the way that CORS and other cross-domain things work, you need to use DNS-style addressing to access your buckets.

    Assuming your original URL is correct (it doesn’t look like it, but I could totally be wrong), you’d want to use this URL instead:

    http://assets-zeke.heroku.com.s3.amazonaws.com/addons-zeke.heroku.com/catalogs/58/original.png
    

    In other words:

    http://{bucket}.s3.amazonaws.com/path/object.ext
    

    Check out: http://docs.amazonwebservices.com/AmazonS3/latest/dev/cors.html for more explanation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Set oXMLHttp=Server.CreateObject(MSXML2.XMLHTTP) On Error Resume Next oXMLHttp.open GET, http://xxxxxx.com,False oXMLHttp.setRequestHeader Content-Type, application/x-www-form-urlencoded oXMLHttp.send() x
After configuring the webservice-server to support CORS by adding Header set Access-Control-Allow-Origin * to
//Set default values $('#name').val('First Last'); $('#email').val('you@email.com'); $('#subject').val('Subject'); $('#message').val('Message'); //Change style when user types $('#name,#email,#subject,#message').keypress(function()
I have the following code, obtained from http://jakearchibald.com/scratch/alphavid/ $(#video).append('<video id=movie style=display:none autobuffer><source id=srcMp4 src=https://host-away-from-host.com/file.mp4
SET @whereCond = @whereCond + ' AND name LIKE ''%'' + @name + ''%'''
I am stuck with this CORS problem, even though I set the server (nginx/node.js)
set(TestProject_additional_libs optimized foobar.lib debug foobard.lib } especially what is optimized/debug mean here? Is this
set Unified=C:\Workspaces\Main\Unified\UnifiedFX.sln set Fullserver=C:\Workspaces\Main\Unified\FullServer\Tests\FullServer.Automation\FullServer.Automation.csproj set Management=C:\Workspaces\Main\Unified\Management\Tests\Management.Automation\Management.Automation.csproj set Move=C:\Workspaces\Main\Unified\Move\Tests\Move.Automation\Move.Automation.csproj set d64=Debug|x64 set d86=Debug|x86 for %%a
set<int> A, B; for (int i = 0; i < 100; i++) A.insert(i); for
set batVar_Parameters=/Developer /Test=0 if not '%batVar_Iteration%' equ '-1' ( set batVar_Parameters=%batVar_Parameters% /Iteration=%batVar_Iteration% ) if

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.