cors

Preflight OPTIONS request to SOAP service does not work

百般思念 提交于 2021-02-07 21:48:31
问题 What I want to do : Call a cross-domain SOAP-Service from JavaScript using jQuery with the jQuery Soap plugin (by Remy Blom). (that is, I call $.soap(); in JavaScript) What I did : CORS Setting on the server side (CXF) are working (using the org.eclipse.jetty.servlets.CrossOriginFilter ), so the following is present in the answer: Access-Control-Allow-Head... X-Requested-With,Content-Type,Accept,Origin Access-Control-Allow-Meth... GET,POST,OPTIONS,HEAD Access-Control-Allow-Orig... http:/

Should non-2xx status code responses include CORS specific headers

帅比萌擦擦* 提交于 2021-02-07 20:15:51
问题 Should non-2XX status code responses still include CORS specific headers such as Access-Control-Allow-Origin , Access-Control-Allow-Methods , and Access-Control-Max-Age ? Does that even make any sense for clients? For example: ➜ api git:(master) ✗ curl -i http://127.0.0.1:9000/dfas HTTP/1.1 404 Not Found Connection: close Server: Node.js v6.3.1 Cache-Control: no-cache, no-store Access-Control-Max-Age: 300 Access-Control-Allow-Origin: * Content-Type: application/json Content-Length: 60 Date:

Should non-2xx status code responses include CORS specific headers

送分小仙女□ 提交于 2021-02-07 20:15:38
问题 Should non-2XX status code responses still include CORS specific headers such as Access-Control-Allow-Origin , Access-Control-Allow-Methods , and Access-Control-Max-Age ? Does that even make any sense for clients? For example: ➜ api git:(master) ✗ curl -i http://127.0.0.1:9000/dfas HTTP/1.1 404 Not Found Connection: close Server: Node.js v6.3.1 Cache-Control: no-cache, no-store Access-Control-Max-Age: 300 Access-Control-Allow-Origin: * Content-Type: application/json Content-Length: 60 Date:

Ajax request with custom header sent to Web API server with CORS enabled

纵饮孤独 提交于 2021-02-07 19:41:50
问题 I'm trying to get a Web API webservice setup correctly to use CORS but haven't been having much luck with it lately. I have an html page from a mobile app using an ajax request to fetch some data: Webservices.GetUserLevel = function() { var userLevel = null; $.ajax({ url: _CONNECTION_STRING + "getuserlevel/" + _USER_PIN, contentType:'application/json; charset=utf-8', type: 'GET', async: false, cache: false, crossDomain: true, data: { BlackberryPin: _USER_PIN }, beforeSend: function(xhr) { xhr

Ajax request with custom header sent to Web API server with CORS enabled

我的梦境 提交于 2021-02-07 19:41:31
问题 I'm trying to get a Web API webservice setup correctly to use CORS but haven't been having much luck with it lately. I have an html page from a mobile app using an ajax request to fetch some data: Webservices.GetUserLevel = function() { var userLevel = null; $.ajax({ url: _CONNECTION_STRING + "getuserlevel/" + _USER_PIN, contentType:'application/json; charset=utf-8', type: 'GET', async: false, cache: false, crossDomain: true, data: { BlackberryPin: _USER_PIN }, beforeSend: function(xhr) { xhr

C# WEB API CORS does not work

﹥>﹥吖頭↗ 提交于 2021-02-07 14:25:41
问题 Fighting with CORS. I have a site that is making a simple XmlHttpRequest to a WEB API I built in C#. var xhr = new XMLHttpRequest(); xhr.open("GET","https://server/controller/method", true); xhr.send(); In my web.config I have done the following: <httpProtocol> <customHeaders> <add name="Access-Control-Allow-Origin" value="*" /> </customHeaders> </httpProtocol> I have also tried installing the Nuget package and doing the following in my WebApiConfig.cs var cors = new EnableCorsAttribute(

Rails assets Cloudfront fontawesome CORS

只谈情不闲聊 提交于 2021-02-07 12:16:36
问题 I tried a lot of solutions found on stackoverflow/github for this issue but I can't get it to work. I'm using font-awesome-rails and I precompile my assets for production. I've set CloudFront for my assets in my production config: config.action_controller.asset_host = "https://XXXX.cloudfront.net" When I load a page (from Chrome/Firefox because Safari is OK with CORS) I get this common error message : Font from origin 'https://XXXX.cloudfront.net' has been blocked from loading by Cross-Origin

Enabling POST/PUT/DELETE on AWS CloudFront?

只愿长相守 提交于 2021-02-07 12:15:24
问题 In AWS CloudFront I set this within: "Allowed HTTP Methods" in the "Default Cache Behavior Settings" area: GET, HEAD, OPTIONS, PUT, POST, PATCH, DELETE My CloudFront is linked to an AWS S3 bucket. So I set the AWS S3 CORS configuration to: <?xml version="1.0" encoding="UTF-8"?> <CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <CORSRule> <AllowedOrigin>*</AllowedOrigin> <AllowedMethod>GET</AllowedMethod> <AllowedMethod>PUT</AllowedMethod> <AllowedMethod>POST</AllowedMethod>

Rails assets Cloudfront fontawesome CORS

百般思念 提交于 2021-02-07 12:14:37
问题 I tried a lot of solutions found on stackoverflow/github for this issue but I can't get it to work. I'm using font-awesome-rails and I precompile my assets for production. I've set CloudFront for my assets in my production config: config.action_controller.asset_host = "https://XXXX.cloudfront.net" When I load a page (from Chrome/Firefox because Safari is OK with CORS) I get this common error message : Font from origin 'https://XXXX.cloudfront.net' has been blocked from loading by Cross-Origin

Enabling POST/PUT/DELETE on AWS CloudFront?

落爺英雄遲暮 提交于 2021-02-07 12:13:43
问题 In AWS CloudFront I set this within: "Allowed HTTP Methods" in the "Default Cache Behavior Settings" area: GET, HEAD, OPTIONS, PUT, POST, PATCH, DELETE My CloudFront is linked to an AWS S3 bucket. So I set the AWS S3 CORS configuration to: <?xml version="1.0" encoding="UTF-8"?> <CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <CORSRule> <AllowedOrigin>*</AllowedOrigin> <AllowedMethod>GET</AllowedMethod> <AllowedMethod>PUT</AllowedMethod> <AllowedMethod>POST</AllowedMethod>