cross-domain

Origin is not allowed by Access-Control-Allow-Origin - how to enable CORS using a very simple web stack and guice

ε祈祈猫儿з 提交于 2019-12-18 02:44:27
问题 I am not sure if the issue is the technologies involved, or my understanding of the technologies. I have an html5 application written in javascript and html hosted on an apache 2.2 server. I have a java application written in java using jetty, guice, jackson, jersey that hosts a simple REST service. Both applications run on the same box, one on port 80 (pure html5 application hosted on apache), the other on 8080 (pure java application hosted on jetty/guice) I believe the answer is in the

How can I validate/secure/authenticate a JavaScript-based POST request?

和自甴很熟 提交于 2019-12-18 00:16:11
问题 A product I'm helping to develop will basically work like this: A Web publisher creates a new page on their site that includes a <script> from our server. When a visitor reaches that new page, that <script> gathers the text content of the page and sends it to our server via a POST request (cross-domain, using a <form> inside of an <iframe> ). Our server processes the text content and returns a response (via JSONP) that includes an HTML fragment listing links to related content around the Web.

apache mod_proxy, configuring ProxyPass & ProxyPassReverse for cross-domain ajax calls

偶尔善良 提交于 2019-12-17 23:48:49
问题 I'm creating an html5 - JavaScript app (for mobile devices, using PhoneGap). I have to interact with a REST service. The service is now running on "http://localhost:8080/backend/mvc/" I'm developing my app on an wamp server (apache2) ( http://localhost/stage/ ) I'm using Chrome for browser. when preforming an ajax call the browser responds: XMLHttpRequest cannot load http://localhost:8080/backend/mvc/event. Origin http://localhost is not allowed by Access-Control-Allow-Origin. So I find

apache mod_proxy, configuring ProxyPass & ProxyPassReverse for cross-domain ajax calls

孤人 提交于 2019-12-17 23:48:00
问题 I'm creating an html5 - JavaScript app (for mobile devices, using PhoneGap). I have to interact with a REST service. The service is now running on "http://localhost:8080/backend/mvc/" I'm developing my app on an wamp server (apache2) ( http://localhost/stage/ ) I'm using Chrome for browser. when preforming an ajax call the browser responds: XMLHttpRequest cannot load http://localhost:8080/backend/mvc/event. Origin http://localhost is not allowed by Access-Control-Allow-Origin. So I find

Check if same origin policy applies

♀尐吖头ヾ 提交于 2019-12-17 22:15:21
问题 Is there a "safe" way to check if the same origin policy applies to an URL before actually trying to use ajax methods? Here is what I have: function testSameOrigin(url) { var loc = window.location, a = document.createElement('a'); a.href = url; return a.hostname == loc.hostname && a.port == loc.port && a.protocol == loc.protocol; } This sort of works, but it’s kind of a manual guess based on the wikipedia article. Is there a better way of pre-checking cross domain allowance? jQuery is OK to

IE 11 first-party session cookies being lost in iframe

江枫思渺然 提交于 2019-12-17 21:42:03
问题 We have a site (www.example.com) which sends users off to a series of third party pages to verify payment details, which we do in an iframe. Initially, a local page from www.example.com is loaded in the iframe, and the user is redirected to the third party URL. Once the third party steps are completed by the user, they are 302 redirected back to a page on our site (www.example.com) within the iframe. This works in all browsers we've tested except IE 11, where our cookies appear to be lost. We

Request header field Access-Control-Allow-Headers is not allowed by Access-Control-Allow-Headers in preflight response

℡╲_俬逩灬. 提交于 2019-12-17 20:44:10
问题 I am trying to make a login page from cross domain but I couldn't solve the problem, the error is: XMLHttpRequest cannot load http://localhost/testing/resp.php. Request header field Access-Control-Allow-Headers is not allowed by Access-Control-Allow-Headers in preflight response. My Javascript code is: $('#login').click(function(){ var username = $('#uname').val(); var password = $('#pass').val(); var result = $('.result'); result.text('loading....'); if (username != '' && password !=''){ var

How to fix this (probably) cross domain policy error using Flash, Socket.IO and NodeJS

爷,独闯天下 提交于 2019-12-17 20:42:24
问题 Error #2044: Unhandled SecurityErrorEvent:. text=Error #2048: Security sandbox violation: http://kipos.bluecodestudio.com/holdthebomb/HoldTheBombWeb.swf cannot load data from http://23.29.126.76:8000/socket.io/1/?t=1356891827452. at io::Socket/doHandshake()[/Users/airrider3/github/AS3-Socket.IO-XHR-Polling/xhr-polling/src/io/Socket.as:139] at io::Socket/connect()[/Users/airrider3/github/AS3-Socket.IO-XHR-Polling/xhr-polling/src/io/Socket.as:110] at io::Socket()[/Users/airrider3/github/AS3

Adapt ajax for crossdomain

我的梦境 提交于 2019-12-17 20:32:21
问题 Is it possible adapt this code for crossdomain and how function makeRequest(url) { var http_request = false; if (window.XMLHttpRequest) { // Mozilla, Safari,... http_request = new XMLHttpRequest(); if (http_request.overrideMimeType) { http_request.overrideMimeType('text/xml'); } } else if (window.ActiveXObject) { // IE try { http_request = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { http_request = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {} } } if (!http_request) {

Phonegap Cross-domain AJAX POST Request not working on Android

允我心安 提交于 2019-12-17 18:55:11
问题 Cross-domain AJAX POST request works perfectly fine on web browsers including browsers on mobile phones, but doesn't work for native applications built using Phonegap I have created a login form that users have to enter their login credentials, then they are verified by the server that is hosted on heroku and returns json {"success":true} if valid credentials are entered. My Ajax script: $.ajax({ type: "POST", url: "http://domain.com/public/auth/app-login", contentType: "application/x-www