Search Posts

Category: cors

preflight request doesn’t pass access No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Unable to access API [duplicate]

This question already has an answer here: How to enable CORS in AngularJs 4 answers I am supposed to create a MEAN app, where i have to consume a news blog API and show it in my HTML. I am supposed to do it in the way : curl –get –include My Node (index.js) code is – My Node (index.js) code is – Here i created a server and enabled cors if i am right […]

Ionic v1 successful $http POST triggering error callback with status -1

Using package.json “angular”: “1.5.3”, “ionic”: “driftyco/ionic-bower#v1.3.3” and wondering why I’m getting an “error” callback triggered when I run at $http post when I install an app on my phone via Xcode. When I run this code … $“”, {“text”: “success!”}).then(function(resp){ console.log(“Success … but I don’t fire”); }, function(resp){ // I fire instead (error callback) console.log(resp); console.warn(“For some reason, Ionic notes this as an aborted request, but the AWS CloudWatch logs record it as successful and […]

Response Headers Gets changed on making Java REST API call from AngularJS

My main issue is, that when I make a GET call to a JAVA API, it hits correctly. I’ve set the CORS headers as well in JAVA API. But when i make a POST request, I see that , the response headers are not what I’ve set for CORS. Even the content-type which i Use as ‘application/json’ gets changed to ‘application/vnd.sun.wadl+xml’ in Response when I see the response header feilds in developer Tool. And that’s […]

Spring MVC + CORS + Angular Js issue [on hold]

I have 2 applications on 2 different servers, say and Both have Spring Security authentication. I login to and make a HTTP get call to service. I have set Allow access headers at through a CORS filter. But when I do so, it redirects me to login page since spring security is there at as well. Since I am using Spring Security 3.2, I can’t use @crossOrigin annotation. I […]

Best solution to overcome "Response to preflight request doesn’t pass access control check" ERROR [duplicate]

This question already has an answer here: How to enable CORS in AngularJs 4 answers I have my angularJS website now I am facing a problem that when user is opening my website using www then when I am making an Http call to my server then i am not getting any error, but when the user is opening my website without www then I am getting error. Response to preflight request doesn’t pass access […]

Cors issue due to siteminder agent sso

My angular application and node js APIs are deployed on a server where SSO enabled on server. Both api code and angular code are present on same server inspite of that we are getting cors issue when trying to consume node api from angular application. Error below: Failed to load$SM$%2fEKIeDbYLIMR01cs0kxVQ9nXLIhXu2gMjpdC8PeQc6wc8jlcGIcuF5uIlal07fmj&TARGET=$SM$https%3a%2f%2fmyvzcloud%2everizon%2ecom%2fapps%2fASTProd%2fASTAPI%2fSuppression%2fCASPER%2f0%2e9979255049237719: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘‘ is therefore not allowed access. Source: AngularJS

Centralized session in multiple product having different domain

I am developing centralized admin module for multiple product. Trying to maintain same session across multiple product. For Product1 : Authenticate successfully and send token in response header Request URL:http://localhost:8080/admin-web/rest/authenticate/ Request Headers Accept:application/json, text/plain, */* Accept-Encoding:gzip, deflate Accept-Language:en-US,en;q=0.8 Cache-Control:no-cache Connection:keep-alive Host:localhost:8080 Origin: Pragma:no-cache Referer: User-Agent:Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.109 Safari/537.36 Response Headers Set-Cookie:token=asdf123sfs1f23sfsf321sfsf21; Version=1; Comment=””; Domain=localhost; Path=/ Access-Control-Allow-Credentials:true Access-Control-Allow-Origin: Content-Encoding:gzip Content-Type:application/json Date:Mon, 13 Nov 2017 12:38:27 GMT Server:Apache-Coyote/1.1 Transfer-Encoding:chunked Vary:Origin Vary:Accept-Encoding […]

CORS issue between web/android/ios

when trying to $.ajax to fetch some content from other websites in my website, I got the error. Failed to load No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://localhost:8100‘ is therefore not allowed access. I knew if the target website didn’t allow localhost:8100 to fetch the data, I cannot fetch it in the client side on the web. However, I found that mobile app (not mobile browser, but android/ios application) does […]

NodeJS. Error: unable to verify the first certificate

I’m programming a web application with AngularJS and I use NodeJS because of CORS problems. Well, when I’m trying to make the request in my node I get this error: events.js:160 throw er; // Unhandled ‘error’ event ^ Error: unable to verify the first certificate at Error (native) at TLSSocket.<anonymous> (_tls_wrap.js:1092:38) at emitNone (events.js:86:13) at TLSSocket.emit (events.js:185:7) at TLSSocket._finishInit (_tls_wrap.js:610:8) at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:440:38) My NodeJS file (index.js): var express = require(‘express’) var cors = require(‘cors’) […]

Response for preflight has invalid HTTP status code 400 (CORS enabled in browser)

I am working on Angular 1 / tech stack based web application. For some reason, I can not deploy api server on my local env, using Production server. And I launched UI side with nginx in local env. Login page is: http://localhost:8080/login.html And when click login button, it calls API from production server. But I am getting error: Response for preflight has invalid HTTP status code 400 I opened Cross domain option in […]

Next Page »