简体   繁体   中英

Can someone explain the diction in the error: "Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin'..."?

I know this issue is all over stack overflow and there are a lot of solutions to it, but my questions is regarding the phrasing of the error itself and what certain parts mean. Here is the error:

Access to XMLHttpRequest at 'https://microsoft.com' 
(redirected from 'https://apple.com') 
from origin 'https://apple.com' 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.

Is this saying the Microsoft received or sent an XMLHttpRequest ?

Is the originator of the XMLHttpRequest Apple?

I am very confused about what domain this error is stating that the XMLHttpRequest came from!

TL;DR

Is this saying the Microsoft received or sent an XMLHttpRequest ?

Microsoft received the request.

Is the originator of the XMLHttpRequest Apple?

Yes.


More details

I'm assuming that the error message in your question is fictitious and that the URL and origins mentioned are there just as an example. You can read the error message as follows:

from origin 'https://apple.com' has been blocked by CORS policy

Understand: Some page on Web origin https://apple.com issued a cross-origin request that failed the CORS check.

Access to XMLHttpRequest at 'https://microsoft.com' (redirected from 'https://apple.com')

Understand: The request was issued to https://apple.com , which resulted in a cross-origin redirect to https://microsoft.com .

Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

Understand: The cross-origin request to https://microsoft.com was such as to trigger a CORS check, but CORS preflight failed because https://microsoft.com isn't configured to allow Web origin https://apple.com .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM