What is it?
Cross-Origin Resource Sharing is a W3C spec that allows resource sharing across domains. Some resources are allowed to come from any domain, but web fonts and AJAX requests are limited to accessing the same domain as the parent web page. This presents a problem if an AJAX request from www.example1.com wants to request a resource from www.example2.com. In order to fulfill that request a CORS security header will have to be added to the response.
Why?
All modern browsers implement the same-origin policy as a preventative measure to keep attackers from redirecting users to malicious websites. This is a bit unfortunate for development teams implementing APIs to be used across distributed environments. It can be perfectly valid for an API to serve AJAX requests to multiple domains. This is why the CORS spec was introduced and is necessary for teams with environments spanning multiple domains.
How to use it?
To successfully serve a cross-origin request the server side must specify the Access-Control-Allow-Origin and Access-Control-Allow-Methods headers. The Allow-Origin header specifics the domains allowed to access the resource and the Allow-Methods specifies the HTTP methods allowed (GET, PUT, etc). To specify all origins allowed the Allow-Origin header could just specify '*'.
This article has some vast and valuable information about this subject.
ReplyDeletesan francisco social media agency
Their quality deliverables set them up for potential future engagement.
ReplyDeletewebsite and logo design company
I would highly recommend him and may maintain looking to him with regard to search engine optimization support.
ReplyDeleteBay Area web design firms
You guys present there are performing an excellent job.
ReplyDeletebranding consultancy
Hey nice post man! Thanks for incredible info.
ReplyDeletebrand positioning firm
This short article posted only at the web site is truly good.
ReplyDeleteBay Area design firms
I hope you will share such type of impressive contents again with us so that we can utilize it and get more advantage.
ReplyDeleteuser experience design agency
Thanks for letting us know about it, these information are really awesome. You can also check out whatsapp lite apk it will provide you complete apk file with unlock features.
ReplyDeleteMost people have heard of CORS which stands for Cross-Origin Resource Sharing and this serves a critical purpose in improving web security by controlling how resources are shared across domains. Because only specific domains of a computer system are granted access to confidential information, risks are minimised. The students who are conducting tech related assignments can take the help of a cheap assignment writing service to provide an organized format of the findings.
ReplyDelete