I'm receiving a CORS error when trying to call an Actuator Endpoint from an Angular Application.
I know that I can enable CORS allowed origins in application.yaml of the Spring Boot Application.
But what I'm wondering about is that if I make a request from within a Spring Boot Application i don't get a CORS error.
The following line executed from http://localhost:8080 returns a valid response.
var response = new RestTemplate().getForEntity("https://<HOST>/actuator/info", String.class);
When executing this line from my angular application I get a CORS error
this.httpClient.get('https://<HOST>/actuator/info').subscribe((result: any) => {
console.log(result);
});
Both calls are made from localhost, the one from Angular causes a CORS error and the one from Spring Boot doesn't.
Can someone explain this difference to me?