I'm making a reques in Angular 12, with a valid token in the header, in postman it works, however, if I run it from the browser, I get the following error, from origin 'http://localhost:4200' has been blocked by CORS policy: Request header field authorization is not allowed by Access-Control-Allow-Headers in preflight response.
This is part of the core, it's in a service.
token: string = 'eyJ4NXQiOiJNek15Wm1aaE9ERm...';
headers= new HttpHeaders()
.set('Content-type', 'application/json')
.set('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE,PATCH,OPTIONS')
.set('Authorization', 'Bearer '+ this.token);
getUniversal4(): Observable<Catalog>{
console.log(this.headers);
return this.http.get<Catalog>(this.urlEndpointBS, {headers: this.headers});
//return this.http.get(this.urlEndpoint).pipe( map( response => response));
}