cors

CORS and HTTP authentication

安稳与你 提交于 2021-02-10 08:12:29
问题 I'm trying make some ajax queries from domain A to domain B which is behind HTTP basic auth Here is my Jquery (1.9.1) ajax call jQuery.ajax({ method : "POST", data: s, withCredentials: true, headers: { "Authorization" : "Basic " + btoa('user:pass') }, url: "http://domainB/script.php", success: function(data){ console.log(data); } }); And script.php <?php header('Access-Control-Allow-Origin: http://domainA'); header('Access-Control-Allow-Methods: POST'); header('Access-Control-Allow

CORS and HTTP authentication

我只是一个虾纸丫 提交于 2021-02-10 08:10:24
问题 I'm trying make some ajax queries from domain A to domain B which is behind HTTP basic auth Here is my Jquery (1.9.1) ajax call jQuery.ajax({ method : "POST", data: s, withCredentials: true, headers: { "Authorization" : "Basic " + btoa('user:pass') }, url: "http://domainB/script.php", success: function(data){ console.log(data); } }); And script.php <?php header('Access-Control-Allow-Origin: http://domainA'); header('Access-Control-Allow-Methods: POST'); header('Access-Control-Allow

CORS and HTTP authentication

假如想象 提交于 2021-02-10 08:08:06
问题 I'm trying make some ajax queries from domain A to domain B which is behind HTTP basic auth Here is my Jquery (1.9.1) ajax call jQuery.ajax({ method : "POST", data: s, withCredentials: true, headers: { "Authorization" : "Basic " + btoa('user:pass') }, url: "http://domainB/script.php", success: function(data){ console.log(data); } }); And script.php <?php header('Access-Control-Allow-Origin: http://domainA'); header('Access-Control-Allow-Methods: POST'); header('Access-Control-Allow

CORS problem with B2C and Azure App Service

谁都会走 提交于 2021-02-09 11:01:28
问题 I have enabled CORS in my ASP.NET/Angular application by using AddCors and EnableCors in controllers. My application is communicating with AD B2C pages. After build I have this error in the console : Access to XMLHttpRequest at 'https://XXX.b2clogin.com/ (redirected from 'https://XXX.azurewebsites.net/User/Info') from origin 'https://XXX.azurewebsites.net' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Startup.cs : services

CORS problem with B2C and Azure App Service

和自甴很熟 提交于 2021-02-09 11:01:04
问题 I have enabled CORS in my ASP.NET/Angular application by using AddCors and EnableCors in controllers. My application is communicating with AD B2C pages. After build I have this error in the console : Access to XMLHttpRequest at 'https://XXX.b2clogin.com/ (redirected from 'https://XXX.azurewebsites.net/User/Info') from origin 'https://XXX.azurewebsites.net' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Startup.cs : services

How to overcome CORS redirect issue while performing post operation via ajax?

别来无恙 提交于 2021-02-09 10:58:10
问题 I'm able to get signed in to the roundcube instance (hosted at another server) via form submission with post method type from external login form. I'm getting this error (While signing via ajax): XMLHttpRequest cannot load https://192.168.0.7/mail/. The request was redirected to 'https://192.168.0.7/mail/?_task=mail&_token=36e97d50951472c4c65de562a0109e94', which is disallowed for cross-origin requests that require preflight. $.ajax({ type: 'POST', url: 'https://192.168.0.7/mail/', data: {

HTTP Auth request fails in browser due to CORS, ok in Node

喜欢而已 提交于 2021-02-09 10:39:00
问题 I'm stuck trying to diagnose a problem where a GET request with HTTP Basic Auth succeeds in Node, but fails in the browser. The problem manifests directly as a CORS failure (there's no Access-Control-Allow-Origin on the 401 page). request.js:119 OPTIONS http://HOST?PARAMS 401 (Unauthorized) ClientRequest._onFinish @ request.js:119 (anonymous) @ request.js:61 ... 17:53:59.170 localhost/:1 Failed to load http://HOST?PARAMS: Response to preflight request doesn't pass access control check: No

HTTP Auth request fails in browser due to CORS, ok in Node

荒凉一梦 提交于 2021-02-09 10:33:52
问题 I'm stuck trying to diagnose a problem where a GET request with HTTP Basic Auth succeeds in Node, but fails in the browser. The problem manifests directly as a CORS failure (there's no Access-Control-Allow-Origin on the 401 page). request.js:119 OPTIONS http://HOST?PARAMS 401 (Unauthorized) ClientRequest._onFinish @ request.js:119 (anonymous) @ request.js:61 ... 17:53:59.170 localhost/:1 Failed to load http://HOST?PARAMS: Response to preflight request doesn't pass access control check: No

How do I add CORS to a compojure-api app?

你离开我真会死。 提交于 2021-02-09 09:40:16
问题 How can I add CORS to this code snippet? (def app (api {:swagger {:ui "/docs" :spec "/swagger.json"}} (GET "/route-a" [] "a") (GET "/route-b" [] "b") (GET "/route-c" [] "c"))) I would like to use https://github.com/r0man/ring-cors and have tried this, but it did not seem to do anything. I would like to see the response header contain Access-Control-Allow-Origin but it is missing. (-> (api {:swagger {:ui "/docs" :spec "/swagger.json"}} (GET "/route-a" [] "a") (GET "/route-b" [] "b") (GET "

How do I add CORS to a compojure-api app?

大憨熊 提交于 2021-02-09 09:36:17
问题 How can I add CORS to this code snippet? (def app (api {:swagger {:ui "/docs" :spec "/swagger.json"}} (GET "/route-a" [] "a") (GET "/route-b" [] "b") (GET "/route-c" [] "c"))) I would like to use https://github.com/r0man/ring-cors and have tried this, but it did not seem to do anything. I would like to see the response header contain Access-Control-Allow-Origin but it is missing. (-> (api {:swagger {:ui "/docs" :spec "/swagger.json"}} (GET "/route-a" [] "a") (GET "/route-b" [] "b") (GET "