Skip to main content

Posts

Showing posts with the label Cross Domain

SpringBoot : No 'Access-Control-Allow-Origin' Access-Control-Allow-Origin

Points To Remember This error occurs when Server does not allow cross domain headers. Application does not allow cross domain headers. Custom headers provided by request is not accepted by the application. How to Solve : No 'Access-Control-Allow-Origin' Access-Control-Allow-Origin error In order to allow cross domain ajax calls to your Server you need to allow the Cross Domian Headers in your application. You can allow the cross domain requests from your application in Spring boot by adding a CORS Filter as shown below. response.setHeader( "Access-Control-Allow-Origin" , "*" ); response.setHeader( "Access-Control-Allow-Methods" , "POST, GET, OPTIONS, DELETE" ); response.setHeader( "Access-Control-Max-Age" , "3600" ); response.setHeader( "Access-Control-Allow-Headers" , "Content-Type, x-requested-with, X-Custom-Header" ); Here you need to specify the following Headers your application accepts as a co...