cors

Why isn't Ember.js seeing the Access-Control-Allow-Origin header from my server?

吃可爱长大的小学妹 提交于 2019-12-23 02:01:49
问题 My app is an Ember.js front end with a Go API on the server. I created the Ember app using the FixtureAdapter. Now that I have the Go API back end I converted it to RESTAdapter. When I hit my API directly with the browser, I seem to get the appropriate CORS headers back: Access-Control-Allow-Credentials:true Access-Control-Allow-Headers:Origin,x-requested-with Access-Control-Allow-Methods:PUT,PATCH,GET,POST Access-Control-Allow-Origin:* Access-Control-Expose-Headers:Content-Length However,

passport req.isAuthenticated always return false when using angular $http request

南笙酒味 提交于 2019-12-23 01:42:28
问题 I am using passportjs for my user authentication. By using postman , I can successfully login and req.isAuthenticated always returns me true in the subsequence requests after login. By using angular $http , However, login works ok but the req.isAuthenticated always returns me false in the subsequence request. My angular app(localhost:3000) and the node app(heroku) are at different domain. My thoughts was it may relate to either CORS or session cookie since I do not see any cookies in my

CORS not working in my MVC app. Getting Header error despite settings web.config

馋奶兔 提交于 2019-12-23 01:24:14
问题 I am getting the following error when trying to make a CORS request to my MVC app. XMLHttpRequest cannot load http://www.ASite.com/gallery/cors/0. Request header field Cache-Control is not allowed by Access-Control-Allow-Headers. 11576?EventId=3108:1 error: Server responded with 0 code. I have added the following custom headers to my web.config which I thought was supposed to allow CORS requests. Can someone please help. <httpProtocol> <customHeaders> <add name="Access-Control-Allow-Origin"

Mobile only CORS Error: Origin is not allowed by Access-Control-Allow-Origin In Node.js

*爱你&永不变心* 提交于 2019-12-23 00:45:31
问题 I've set up a Node.js (TypeScript hosted on Google Cloud Platform [GCP]) app for CORS but I'm still getting errors (Origin is not allowed by Access-Control-Allow-Origin) on mobile--desktop works fine. I've searched but there are so many questions about getting this set up in general, I can't find why it specifically isn't working for mobile. this.app.use(cors()); this.app.options('*', cors()); ... router.use(function(req, res, next) { res.header('Content-Type', 'application/json'); res

Mobile only CORS Error: Origin is not allowed by Access-Control-Allow-Origin In Node.js

一曲冷凌霜 提交于 2019-12-23 00:45:12
问题 I've set up a Node.js (TypeScript hosted on Google Cloud Platform [GCP]) app for CORS but I'm still getting errors (Origin is not allowed by Access-Control-Allow-Origin) on mobile--desktop works fine. I've searched but there are so many questions about getting this set up in general, I can't find why it specifically isn't working for mobile. this.app.use(cors()); this.app.options('*', cors()); ... router.use(function(req, res, next) { res.header('Content-Type', 'application/json'); res

CORS error Angular 2 + Express Node

一曲冷凌霜 提交于 2019-12-22 17:58:30
问题 Front side(Angular 2) public googlesearch(ev:Event){ this.http.get("https://maps.googleapis.com/maps/api/place/autocomplete/json?input="+ev.target.value+"&types=establishment&key=AIzaSyAKdEt_dYbdPY-CFo0zie23E44XxTQc1n7").map(res => $.parseJSON(res)).subscribe( data => { this.predictions = data.predictions; console.log(this.predictions); },(error) =>{ alert('Not able to get') } ) } Node (Express 4.14) var app = express(); app.use(function(req, res, next) { res.header("Access-Control-Allow

Sending base64 string to c# server

坚强是说给别人听的谎言 提交于 2019-12-22 17:07:31
问题 I made a c# web api at the the moment . It is working fine until today. I've tried to convert an image to a base64string, and then send the base64string to the c# server through ajax. When I did the said steps, an error occur. XMLHttpRequest cannot load http://10.0.10.105:50231/api/hello. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://10.0.10.201' is therefore not allowed access. I dont know where the main problem resides but in my observation,

HTTP CODE 405 (Method Not Allowed), When I sent POST data in ASP.NET WebAPI CORS

▼魔方 西西 提交于 2019-12-22 14:54:11
问题 Web.config <httpProtocol> <customHeaders> <add name="Access-Control-Allow-Origin" value="*" /> <add name="Access-Control-Allow-Headers" value="*" /> <add name="Access-Control-Allow-Methods" value="GET,POST,PUT,DELETE,OPTIONS" /> </customHeaders> </httpProtocol> <handlers> <remove name="WebDAV"/> <remove name="ExtensionlessUrlHandler-Integrated-4.0" /> <remove name="OPTIONSVerbHandler" /> <remove name="TRACEVerbHandler" /> <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*"

No 'Access-Control-Allow-Origin' header is present on the requested resource with Django digitalocean Spaces

隐身守侯 提交于 2019-12-22 13:57:07
问题 My Django website is hosting in digitalocean ubuntu 16.04 with Nginx. I have setup digitalocean CORS Configurations as here https://www.digitalocean.com/docs/spaces/how-to/cors/ I added my domian name in the 'origin',checked all the options in 'Allowed Methods',the only thing I haven't done is add headers in 'Alowed Headers' because I have no idea what to add. When I use digitalocean Spaces(a service based on and very similar as Amazon S3) as my static and media file storage.There is No

How to resolve CORS issue and JSONP issue in Ionic2

混江龙づ霸主 提交于 2019-12-22 12:39:13
问题 I am new to IONIC-2 and want to connect my mobile app to Odoo - open source ecommerce .. this connection involves some JSONP request.. I have done the same through jQuery previously.. its working properly in phonegap app.. but while I am doing the same thing with IONIC-2 it gives me CORS and JSONP errors.. can someone help me in this.. my previous jQuery code is.. /****** index.js ******/ function json(url, params) { var deferred = jQuery.Deferred(); uniq_id_counter += 1; var payload = {