An origin is the scheme, host, and port tuple that identifies a web resource’s security context. Browsers use it when deciding whether a cross-origin response may be accepted. section 10.1
A request from http://localhost:8080 to http://127.0.0.1:8080 is cross-origin because the hosts differ. Without an accepted origin in Access-Control-Allow-Origin, the browser rejects the response, even if the server processes the request. section 10.1
A cross-origin request
A page loaded from http://localhost:8080 sends XMLHttpRequest to http://127.0.0.1:8080/test. The server logs the call, but the browser refuses the response because no Access-Control-Allow-Origin header permits the requesting origin.


