S3 – Access-Control-Allow-Origin Header

Did anyone manage to add Access-Control-Allow-Origin to the response headers? What I need is something like this: <img src=”http://360assets.s3.amazonaws.com/tours/8b16734d-336c-48c7-95c4-3a93fa023a57/1_AU_COM_180212_Areitbahn_Hahnkoplift_Bergstation.tiles/l2_f_0101.jpg” /> This get request should contain in the response, header, Access-Control-Allow-Origin: * My CORS settings for the bucket looks like this: <?xml version=”1.0″ encoding=”UTF-8″?> <CORSConfiguration xmlns=”http://s3.amazonaws.com/doc/2006-03-01/”> <CORSRule> <AllowedOrigin>*</AllowedOrigin> <AllowedMethod>GET</AllowedMethod> <MaxAgeSeconds>3000</MaxAgeSeconds> <AllowedHeader>*</AllowedHeader> </CORSRule> </CORSConfiguration> As you might … Read more

Why does my http://localhost CORS origin not work?

I am stuck with this CORS problem, even though I set the server (nginx/node.js) with the appropriate headers. I can see in Chrome Network pane -> Response Headers: Access-Control-Allow-Origin:http://localhost which should do the trick. Here’s the code that I now use to test: var xhr = new XMLHttpRequest(); xhr.onload = function() { console.log(‘xhr loaded’); }; … Read more

Request header field Access-Control-Allow-Headers is not allowed by Access-Control-Allow-Headers

I’m trying to send files to my server with a post request, but when it sends it causes the error: Request header field Content-Type is not allowed by Access-Control-Allow-Headers. So I googled the error and added the headers: $http.post($rootScope.URL, {params: arguments}, {headers: { “Access-Control-Allow-Origin” : “*”, “Access-Control-Allow-Methods” : “GET,POST,PUT,DELETE,OPTIONS”, “Access-Control-Allow-Headers”: “Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With” } … Read more

AngularJS performs an OPTIONS HTTP request for a cross-origin resource

I’m trying to setup AngularJS to communicate with a cross-origin resource where the asset host which delivers my template files is on a different domain and therefore the XHR request that angular performs must be cross-domain. I’ve added the appropriate CORS header to my server for the HTTP request to make this work, but it … Read more

What’s the point of the X-Requested-With header?

JQuery and other frameworks add the following header: X-Requested-With: XMLHttpRequest Why is this needed? Why would a server want to treat AJAX requests differently than normal requests? UPDATE: I just found a real-life example using this header: https://core.spreedly.com/manual/payment-methods/adding-with-js. If the payment processor is requested without AJAX, it redirects back to the original website when it’s … Read more

No ‘Access-Control-Allow-Origin’ – Node / Apache Port Issue

i’ve created a small API using Node/Express and trying to pull data using Angularjs but as my html page is running under apache on localhost:8888 and node API is listen on port 3000, i am getting the No ‘Access-Control-Allow-Origin’. I tried using node-http-proxy and Vhosts Apache but not having much succes, please see full error … Read more

Trying to use fetch and pass in mode: no-cors

I can hit this endpoint, http://catfacts-api.appspot.com/api/facts?number=99 via Postman and it returns JSON Additionally I am using create-react-app and would like to avoid setting up any server config. In my client code I am trying to use fetch to do the same thing, but I get the error: No ‘Access-Control-Allow-Origin’ header is present on the requested … Read more