cors

IOS - CORS in WKWebView from local HTML file

匆匆过客 提交于 2019-12-24 06:35:34
问题 I am loading a local HTML page inside a WebView in an IOS application (using Xamarin but I don't think it changes anything) This local HTML page makes ajax requests to a remote server. Everything works fine if I use an UIWebView, but when I try to use a WKWebView instead it fails. It fails because of CORS, I tried with the following HTML source: <html> <body> <script src="http://code.jquery.com/jquery-2.1.4.min.js"></script> <h1>Test AJAX Requests</h1> <br /> <button type="button" onclick=

CORS - Calling rest services on Tomcat from angular

杀马特。学长 韩版系。学妹 提交于 2019-12-24 06:24:10
问题 I am trying to call REST services deployed on Tomcat 8 from Angular 4. Since both these are running on separate domains, CORS issue is expected. So, in the tomcat/conf/web.xml, I have added the below filter <filter> <filter-name>CorsFilter</filter-name> <filter-class>org.apache.catalina.filters.CorsFilter</filter-class> <init-param> <param-name>cors.allowed.origins</param-name> <param-value>*</param-value> </init-param> <init-param> <param-name>cors.allowed.methods</param-name> <param-value

How to make ajax call to AWS S3 bucket to get file names from folder?

大憨熊 提交于 2019-12-24 05:57:25
问题 I am trying to get image file names from folder to add them dynamically as an HTML element to my web page. In order to do that, I found this piece of code which works perfectly on the local host. var folder = "img/gallery/"; $.ajax({ url: folder, success: function(data) { $(data).find("a").attr("href", function(i, val) { if (val.match(/\.(jpe?g|png|gif)$/)) { // TODO: Filter and Title strings needs to be changed var lightboxElement = "<img src=\"img\/gallery\/" + val + "\">"; $("#lightbox")

How to make ajax call to AWS S3 bucket to get file names from folder?

泄露秘密 提交于 2019-12-24 05:57:07
问题 I am trying to get image file names from folder to add them dynamically as an HTML element to my web page. In order to do that, I found this piece of code which works perfectly on the local host. var folder = "img/gallery/"; $.ajax({ url: folder, success: function(data) { $(data).find("a").attr("href", function(i, val) { if (val.match(/\.(jpe?g|png|gif)$/)) { // TODO: Filter and Title strings needs to be changed var lightboxElement = "<img src=\"img\/gallery\/" + val + "\">"; $("#lightbox")

Cross Origin Resource Sharing (CORS) via AJAX

梦想的初衷 提交于 2019-12-24 05:37:21
问题 I know there is a lot of questions on this topic and I have been trying to resolve this for some time. Please indulge me in this specific case. My Goal: I am trying to get the JSON data from the following URL: https://www.icims.com/bellworks I am using the following AJAX request: $.ajax({ url: "https://www.icims.com/bellworks", success: function(res){ console.log(res); } }); My Problem: I am getting the following error: Cross-Origin Request Blocked: The Same Origin Policy disallows reading

iframe sends origin as null

こ雲淡風輕ζ 提交于 2019-12-24 03:34:27
问题 I have an iframe to which the content is injected from the third party library I am using. <iframe id="targetIframe"></iframe> The library is injecting a form which user needs to submit. Problem is that when the form is initialized they are doing some requests and header origin is send as a null which is causing a problem because their servers are not allowing null value. I tried to add sandbox attribute, even tried to fake the call but with origin but the iframe is secured with CORS. Is

netty socket io CORS error: Access-Control-Allow-Origin

时光总嘲笑我的痴心妄想 提交于 2019-12-24 03:11:34
问题 I have wamp server running https, java netty socket.io server secured by SSL, and socket.io client. In client I have folowing code: io.connect(url, {secure: true} ); the url is: https://127.0.0.1:8080 When I open in my browser my webserver: https://127.0.0.1 I have following error: socket.io-client:manager reconnect attempt error +1ms socket.io.js (wiersz 1284) socket.io-client:manager will wait 4000ms before reconnect attempt +1ms socket.io.js (wiersz 1284) engine.io-client:socket socket

Firefox does not accept Access-Control-Allow-Origin: *

这一生的挚爱 提交于 2019-12-24 03:08:11
问题 I want to allow access to all origins on my server, but my AJAX requests from http://localhost:8100/ in Firefox keep being rejected. header("Access-Control-Allow-Origin: *"); // allow the use of requests in development (ionic serve in web browser). header("Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS"); header("Access-Control-Max-Age", "3600"); header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Authorization");; "Cross-Origin Request Blocked

CORS AWS S3 and cloudfront

烂漫一生 提交于 2019-12-24 02:26:23
问题 I see different headers returned from the server using curl and browsers(FF and Chrome). Curl returns CORS headers curl -X GET -I -H "Origin: https://qa.gameofshred.com" https://s3-ap-southeast-1.amazonaws.com/gameofshred-qa/site/fontawesome-webfont.912ec66d7572ff821749.svg --verbose > GET /gameofshred-qa/site/fontawesome-webfont.912ec66d7572ff821749.svg HTTP/1.1 > User-Agent: curl/7.29.0 > Host: s3-ap-southeast-1.amazonaws.com > Accept: */* > Origin: https://qa.gameofshred.com > < HTTP/1.1

Setting JSON request header in Angular2 HTTP POST

倖福魔咒の 提交于 2019-12-24 01:27:09
问题 I'm having a problem setting a content-type of application/json header on my post request. saveUpdates(alltabs: AllTabs): Observable<Response> { let api = this.host + this.routes.save; let headers = new Headers(); headers.append('Content-Type', 'application/json'); return this._http.post(api, JSON.stringify(alltabs), { headers: headers }) .map((response: Response) => <Response>response.json()) .do(data => console.log("saveUpdates(): " + data)) .catch(this.handleError); } Request Headers: