same-origin-policy

Laravel cors 'Access-Control-Allow-Origin' and 'Access-Control-Allow-Headers'

走远了吗. 提交于 2019-11-27 08:14:18
问题 I am new to Laravel. I tried https://github.com/barryvdh/laravel-cors. When I add header('Access-Control-Allow-Origin: *'); in my public/index.php, it does not add the Content-Type in the response. When I add header('Access-Control-Allow-Origin: *'); header('Access-Control-Allow-Headers: Origin, Content-Type'); It does not add Access-Control-Allow-Origin. I am very confused by all various solutions I find on internet. How exactly should I go about this? 回答1: You can create a new middleware

Access child iFrame DOM from parent page

不想你离开。 提交于 2019-11-27 07:52:39
Here is the deal: domain.com/page -- Parent page (document.domain=domain.com) contains an iframe sub.domain.com/page -- Child iframe (document.domain=not set) is on a subdomain Is there any way to access the DOM of that iframe or am I out of luck? Does same origin policy block me from forcing a document.domain on an iframe contained within a parent page? I suppose that would defeat the purpose of the same origin policy... If that is the case, is there any workaround to access the DOM of the iframe on the rendered parent page? There is a way. When the page in the iframe loads, have it do the

Jquery .load Same origin policy

孤人 提交于 2019-11-27 07:47:40
问题 Is there anyway i can fool the Jquery .load Same origin policy? The closest i've come is with this tutorial. But that only deals with rss feeds. 回答1: The same origin policy is a browser thing, not a jQuery thing. JSON-P is the usual way to work around this and is not limited to RSS feeds. It is even documented in the jQuery documentation (see the example that uses Flickr) 来源: https://stackoverflow.com/questions/2453981/jquery-load-same-origin-policy

Circumventing Chrome Access-control-allow-origin on the local file system?

两盒软妹~` 提交于 2019-11-27 07:35:59
I've read the other same origin policy topics here on SO, but I haven't seen any solutions related to the local file system. I have a web app (In a loose sense of the word) that must be local served. I am trying to load a large amount of data in after the user has loaded the page, depending on what they are doing on the webpage. In Firefox 3.5 and IE8 I am able to use jQuery's AJAX() and GetScript() methods to do this, but in Chrome this fails due to the Same Origin Policy. XMLHttpRequest cannot load file://test/testdir/test.js . Origin null is not allowed by Access-Control-Allow-Origin . This

Same Origin Policy - AJAX & using Public APIs

给你一囗甜甜゛ 提交于 2019-11-27 07:17:16
I know if on my own webpage, if my user is on : http://www.example.com/form.php and I make an ajax request from that page to : http://example.com/responder.php It will fail because of the Same origin policy (subdomain is different). What I am trying to understand is, how is it that AJAX requests can pull data from API's like flickr when the request and server are obviously different. Edit : eg: Why does this code work? $.getJSON('http://api.flickr.com/services/rest/?&;method=flickr...' ( Referred this Community Wiki ) Is it using Cross Origin Resource Sharing ? Thanks! Daniel Vassallo There

Why is same origin policy kicking in when making request from localhost to localhost?

限于喜欢 提交于 2019-11-27 07:09:23
问题 I'm keeping the backend API as a separate project from the frontend HTML5 app consuming it. I'm using Yeoman for the frontend development. Yeoman runs on localhost:3501 and the backend on localhost:3000. When I make the API request from the browser (using AngularJS's $http), I hit the same origin policy: XMLHttpRequest cannot load http://localhost:3000/venues. Origin http://localhost:3501 is not allowed by Access-Control-Allow-Origin. AFAIK, same origin policy should kick in only when making

Why are AJAX requests limited to same domain?

折月煮酒 提交于 2019-11-27 06:49:06
问题 Something I find really confusing, is why are AJAX requests limited to the same domain? What is the reasoning behind this? I don't see any problem with requesting files from external locations, also servers making XMLHTTP requests seem to get and post to external locations fine. 回答1: Picture this : You come on my fabulous website www.halfnakedgirls.com. You have fun watching what looks like technical documentation on human physiology, but behind your back, some lines of JavaScript are

Same origin host, different ports in JS

烂漫一生 提交于 2019-11-27 06:42:56
问题 for the two hosts http://1.com.local/ http://2.com.local:8080/ how can I use document.domain to enable DOM-Manipulation between the two? If i set both to com.local it doesn't work, because the 2nd host then gets the domain com.local:8080 . When I try to set the domain of the first one to com.local:8080 manually, the port is just snipped of and the domain remains com.local . How can I enable DOM-Manipulation in this situation? 回答1: You cannot. Sorry - same origin is including the ports You can

How can ASP.NET or ASP.NET MVC be protected from related domain cookie attacks?

送分小仙女□ 提交于 2019-11-27 05:21:48
问题 The related domain cookie attack (more info) allows machines in the same DNS domain to add additional cookies that will also be sent to other computers in the same domain. This can cause issues with authentication, or at worst be a component in a confused deputy attack. Question How can I protect ASP.NET or ASP.NET MVC from this type of attack? One possible attack scenario I log into a "secure" web app I get the credentials for my account I trick the user into visiting my site on the same DNS

HTML5 Canvas getImageData and Same Origin Policy

删除回忆录丶 提交于 2019-11-27 01:45:44
I have a site running at pixie.strd6.com and images hosted through Amazon S3 with a CNAME for images.pixie.strd6.com. I would like to be able to draw these images to an HTML5 canvas and call the getImageData method but it throws Error: SECURITY_ERR: DOM Exception 18 I have tried setting window.domain = "pixie.strd6.com" , but that has no effect. Additionally, $.get("http://dev.pixie.strd6.com/sprites/8516/thumb.png?1293830982", function(data) {console.log(data)}) also throws an error: XMLHttpRequest cannot load http://dev.pixie.strd6.com/sprites/8516/thumb.png?1293830982 . Origin http://pixie