cross-domain

cross domain posts to ASP.Net MVC app

混江龙づ霸主 提交于 2019-12-18 21:02:12
问题 I'm developing an app where HTML and javascript chunks are delivered down to different clients. I'm able to GET the html/javascript chunks by adding the following to web config file: <system.webServer> <modules runAllManagedModulesForAllRequests="true" /> <httpProtocol> <customHeaders> <add name="Access-Control-Allow-Origin" value="*" /> <add name="Access-Control-Allow-Headers" value="Content-Type" /> <add name="Access-Control-Allow-Methods" value="POST, GET, OPTIONS" /> </customHeaders> <

XDomainRequest aborts POST on IE 9

烈酒焚心 提交于 2019-12-18 16:56:54
问题 I am doing a cross domain Ajax call. My Code: if (window.XDomainRequest) // Check whether the browser supports XDR. { xdr = new XDomainRequest(); // Create a new XDR object. if (xdr) { xdr.timeout = 3000;//Set the timeout time to 3 second. xdr.onload = function () { alert("Success"); }; xdr.onerror = function () { alert("Error"); }; xdr.ontimeout = function () { alert("Error"); }; xdr.open("post", urlSearch); xdr.send(); } } else { $.ajax({ url: urlSearch, type: 'POST', dataType: 'json',

Why doesn't setting document.domain work to allow AJAX requests to a parent domain?

…衆ロ難τιáo~ 提交于 2019-12-18 16:53:34
问题 I have two files, domain.com/test2.php: <div id="testDiv"></div> <script src="http://domain.com/packages/jquery.js"></script> <script>$("#testDiv").load("http://domain.com/test3.php", {var1:1, var2:2});</script> and domain.com/test3.php: <b>var1: <?php echo $var1; ?> , var2: <?php echo $var2; ?></b> In this case domain.com/test2.php outputs var1: 1 , var2: 2 as one would expect, but let's now say I want to make a test2.php in a subdomain. To stop problems with cross-domain scripting, I would

Why doesn't setting document.domain work to allow AJAX requests to a parent domain?

自闭症网瘾萝莉.ら 提交于 2019-12-18 16:53:05
问题 I have two files, domain.com/test2.php: <div id="testDiv"></div> <script src="http://domain.com/packages/jquery.js"></script> <script>$("#testDiv").load("http://domain.com/test3.php", {var1:1, var2:2});</script> and domain.com/test3.php: <b>var1: <?php echo $var1; ?> , var2: <?php echo $var2; ?></b> In this case domain.com/test2.php outputs var1: 1 , var2: 2 as one would expect, but let's now say I want to make a test2.php in a subdomain. To stop problems with cross-domain scripting, I would

Can I impersonate a user on a different Active Directory domain in .NET?

送分小仙女□ 提交于 2019-12-18 16:51:37
问题 I have two Active Directory domains, A and B. Users in domain A need to run an application on their desktops to view and manipulate a resource located on a server in domain B. Each user also has an account in domain B. Is it possible to impersonate each user's domain B identity to perform operations on the domain B resource programatically? Example Workflow: User logs in to domain A. User launches desktop application. User specifies resource in domain B. Application prompts user for domain B

Response to preflight request doesn't pass access control check Laravel and Ajax call

纵饮孤独 提交于 2019-12-18 16:30:13
问题 I have a REST api made in Laravel 5.1 hosted in a remote server. Now, I', trying to consume that API from another website (that I have in local). In Laravel I set the required lines to send the CORS headers. I also tested the API using Postman and everything seems to be ok! In the Frontend Then, in the website I sent the POST request using ajax, with this code: var url="http://xxx.xxx.xxx.xxx/apiLocation"; var data=$("#my-form").serialize(); $.ajax({ type: "POST", url: url, data: data,

Is it Possible to Make Cross-Domain Requests in Javascript AND Set Custom Headers?

时光总嘲笑我的痴心妄想 提交于 2019-12-18 12:37:06
问题 Since you can't apply custom headers on JSONP calls, how do I make cross domain requests AND apply custom headers using jQuery? I'm basically trying to access google docs with jQuery and need to pass an authentication token: var token = "my-auth-token"; $.ajax({ url: "http://docs.google.com/feeds/documents/private/full?max-results=1&alt=json", dataType: 'json', beforeSend: function(xhr) { xhr.setRequestHeader("Authorization", "GoogleLogin auth=" + token); }, success: function(data, textStatus

XMLNS W3 URL for SVG spec now throwing error in Chrome

萝らか妹 提交于 2019-12-18 12:16:35
问题 I used this SVG mask for grayscale in browsers where filter: grayscale(100%) doesn't work: filter: url("data:image/svg+xml;utf8,<svg version='1.1' xmlns='http://www.w3.org/2000/svg' height='0'><filter id='greyscale'><feColorMatrix type='matrix' values='0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0' /></filter></svg>#greyscale"); A little while back, this worked perfectly fine, but now I get this error in console: Unsafe attempt to load URL data:image/svg

What kind of network error is Chrome encountering when 'Status = (failed)' and 'Type = undefined'

ぃ、小莉子 提交于 2019-12-18 12:15:41
问题 Sometimes I randomly see network requests from Chrome failing with Status = '(failed)' (status code 0 from the request object in JavaScript) and the response type as 'undefined' . I cannot isolate why, my internet connection seems to be up and the same endpoint on the server works if requested from say cURL. Viewing the request details does not show any more response information, only the request info. I thought it might be missing CORS headers, but I have verified they are there and anyway

Spring Global CORS configuration not working but Controller level config does

别等时光非礼了梦想. 提交于 2019-12-18 12:08:30
问题 I am trying to configure CORS globally via WebMvcConfigurerAdapter shown below. To test I am hitting my API endpoint via a small node app I created to emulate an external service. When I try this approach the response does not contain the correct headers and fails with XMLHttpRequest cannot load http://localhost:8080/api/query/1121. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:333' is therefore not allowed access. Global Config import