Error: Access to XMLHttpRequest at ‘http://10.12.13.39:8080/content/fetchAllcontent/1/Books/Philosophy’ from origin ‘http://localhost’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.
Solution: Add the below code in /opt/tomcat/conf/web.xml you can replace * in cors.allowed.origins with the domain you want eg: gokuldeepak.com
<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>GET,POST,PUT,DELETE,HEAD,OPTIONS</param-value> </init-param> <init-param> <param-name>cors.allowed.headers</param-name> <param-value>Content-Type,X-Requested-With,Accept,Authorization,Origin,Access-Control-Request-Method,Access-Control-Request-Headers</param-value> </init-param> <init-param> <param-name>cors.exposed.headers</param-name> <param-value>Access-Control-Allow-Origin,Access-Control-Allow-Credentials</param-value> </init-param> </filter> <filter-mapping> <filter-name>CorsFilter</filter-name> <url-pattern> /* </url-pattern> </filter-mapping>
Linux has a convenient feature of running cronjob which will get executed at the correct…
As famous Tamil poet Auvaiyar said "Katradhu Kai Mann Alavu, Kallathathu Ulaga Alavu" which is…
Terraform Cheatsheet with pdf. You can download Terraform Cheatsheet pdf with all Terraform CLI commands…
I was planning to do Terraform certification a long time ago. I have worked on…
As a user of both of these services has got multiple benefits with both of…
You need not memorize these important docker commands. Repeated usage will make it easy for…
This website uses cookies.