mercredi 17 novembre 2021

Why CORS headers does not concern http requests from the browser

I want to understand in depth CORS.

If we consider the definition of https://developer.mozilla.org/:

Cross-Origin Resource Sharing (CORS) is an HTTP-header based mechanism that allows a server to indicate any origins (domain, scheme, or port) other than its own from which a browser should permit loading resources.

So my question is quite simple :

Its normal if CORS policy is triggered if we use fetch() from a website hosted on a separate server (separate ip). But the question is, why when we make a HTTP request from a browser to a particular website the CORS policy is not triggered ,knowing that the source of the request comes from a different ip from that of the server hosting the website ?

Thanks in advance




Aucun commentaire:

Enregistrer un commentaire