cors

Recaptcha documentation unclear - and cross-site error testing it

谁说我不能喝 提交于 2020-01-01 04:45:10
问题 Can anybody please clear up for me what the final page of the recaptcha documentation is saying, I find it exceptionally obtuse. Here's the documentation I fail to understand: Verifying the user's response This page explains how to verify a user's response to a reCAPTCHA challenge from your application's backend. When a reCAPTCHA is solved by end user, a new field (g-recaptcha-response) will be populated in HTML. You can verify the user’s response in one of three ways: g-recaptcha-response

XMLHttpRequest CORS to Google Cloud Storage only working in preflight request

╄→尐↘猪︶ㄣ 提交于 2020-01-01 04:31:30
问题 I implemented browser based resumable uploads into Google's Cloud Storage using an XMLHttpRequest send to a server-side created resumable upload url. This works completely fine when disabling web security, which I did during development. But now in the real world, CORS keeps making trouble. I tried this with other browsers (without success), too, but sticked to chrome for further testing. Note: A fake.host entry in /etc/HOSTS is used to trick chrome into avoiding localhost-restrictions.

XmlHttpRequest CORS POST sent without cookies

谁说胖子不能爱 提交于 2020-01-01 04:17:51
问题 I have a Rails service returning data for my AngularJS frontend application. The service is configured to allow CORS requests by returning the adequate headers. When I make a GET request to receive data, the CORS headers are sent, as well as the session cookie that I have previously received on login, you can see for yourself: Request URL:http://10.211.194.121:3000/valoradores Request Method:GET Status Code:200 OK Request Headers Accept:application/json, text/plain, */* Accept-Encoding:gzip

Is there a way to enable CORS on Github pages?

半腔热情 提交于 2020-01-01 04:10:08
问题 I'm hosting some JSON files on Github pages, but I am unable to use $.getJSON to retrieve them unless they come from the exact same domain. Is there a way to enable CORS for Github pages? 回答1: As a workaround one can use JSONP, but it's still slightly a pain because the files are static, and each one will need a unique callback method. Another alternative would be to store the files in Gists and use the Github API which works with CORS. A third possibility is to not store the files on Github

cross-origin video in Safari

余生长醉 提交于 2020-01-01 03:28:06
问题 Does anyone know if Safari supports crossorigin attribute on the HTML5 <video> tag? I serve video from a server that responds with all needed CORS headers, and I use the markup below to embed the video to my page. The page is served from a different domain. <video controls crossorigin="anonymous" src="http://example.com/movie.mp4"> I then draw the video to a canvas and get the image from the canvas using toDataURL API. This works in Chrome and Firefox, but Safari throws the security error as

MobileSafari won't send back Cookies set with CORS

爱⌒轻易说出口 提交于 2020-01-01 02:33:26
问题 I have a page loading up in MobileSafari which communicated with another server via CORS. In desktop browsers (tested Chrome and Safari), I am able to log in, get a session cookie, and have that session cookie be sent back for subsequent requests so that I may be authenticated with all API calls. However, when I login via Mobile Safari, the cookie does not get sent back on subsequent requests. I'm using Charles Proxy to spy on what's going on, and it tells me: POST https://myremoteserver.com

Set headers on get request angular 2

独自空忆成欢 提交于 2020-01-01 02:16:12
问题 I try to set an Authorization header to a GET request to authenticate users to a rest API. I'm using Angular 2 RC1. (I'am a total beginner). getTest(){ let authToken = localStorage.getItem('auth_token'); let headers = new Headers({ 'Content-Type': 'application/json' }); headers.append('Authorization', `Bearer ${authToken}`); let options = new RequestOptions({ headers: headers }); return this._http .get(this._url,options) .map(res => console.log(res)); } I allow CORS in my backend. header(

Refused to set unsafe header “Origin” when using xmlHttpRequest of Google Chrome

人走茶凉 提交于 2019-12-31 12:36:20
问题 Got this error message: Refused to set unsafe header "Origin" Using this code: function getResponse() { document.getElementById("_receivedMsgLabel").innerHTML += "getResponse() called.<br/>"; if (receiveReq.readyState == 4 || receiveReq.readyState == 0) { receiveReq.open("GET", "http://L45723:1802", true, "server", "server123"); //must use L45723:1802 at work. receiveReq.onreadystatechange = handleReceiveMessage; receiveReq.setRequestHeader("Origin", "http://localhost/"); receiveReq

Angular: A wildcard '*' cannot be used in the 'Access-Control-Allow-Origin' header when the credentials flag is true

做~自己de王妃 提交于 2019-12-31 12:21:11
问题 I know there are a lot of questions concerning CORS already but they don't seem to answer my question. So I have a client app written in Angular which will be used to create a mobile app (with Apache Cordova). The html files and JavaScript files will be loaded from the mobile device. When I simulate that and I send requests to the REST API server I first got "No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin ' http://localhost:82 ' is therefore not allowed

Super slow preflight OPTIONS in Chrome only

▼魔方 西西 提交于 2019-12-31 11:42:43
问题 I've been struggling recently with a super-weird problem only happening in Chrome: as my API (NodeJS) is on a different subdomain, I need to use CORS to reach it from my front-end (EmberJS). It's working pretty well but I'm very frequently (95% of the time) having very very slow OPTIONS queries, delaying any API calls by about 3 seconds. Most of this time is spent downloading an empty content: It gets even weirder when I'm trying this on another website we made using a similar architecture,