concept url in category cors

appears as: URL, URL, The URL, URLs
CORS in Action: Creating and consuming cross-origin APIs

This is an excerpt from Manning's book CORS in Action: Creating and consuming cross-origin APIs.

The first and last lines are the same for same-origin and cross-origin requests. The first line creates the XMLHttpRequest object, the last sets the HTTP method and URL.

Figure 6.1 illustrates the dangers of allowing all origins over a VPN. Suppose there are some private internal documents on your company’s intranet, which happens to have the Access-Control-Allow-Origin: * header set. As an employee, because you’re able to connect to the firewall, you’re able to access these documents using CORS. Now suppose some malicious hacker would like to access this document as well. He knows the URL, but he can’t make a request to the document because he isn’t on the firewall.

The Access-Control-Max-Age indicates the maximum number of seconds to cache a preflight request. For example, setting the header to a value of 120 will wait two minutes before issuing a new preflight request to the URL.