Blocked by CORS only on post request

When i make a request to my api, chrome block my request cause of cores. On my firebase cloud function, i added response.set(‘Access-Control-Allow-Origin’,’*’); (xxxxxx in the axios get is just to hide the request url )

export const getApproximateAddress = functions.https.onRequest(async(request, response)=>{
 try{
     response.set('Access-Control-Allow-Origin','*');
     response.set('Access-Control-Allow-Methods','GET, POST, PATCH, PUT, DELETE, OPTIONS');
     let data = JSON.parse(request.body);
     let lat = "";
     let lng = "";
     let hasCoords = false;
     if( data.lat !== undefined && data.lng !== undefined){
         lat = data.lat;
         lng = data.lng;
         hasCoords = true;
     }
     let place = data.place;
     let result;
     if(hasCoords){
         result = await axios.get(`xxxxxxxx`);
         console.log("hehe");
     }else{
         result = await axios.get(`xxxxxxxx`);
     }
     if(result.status !== 200){
        response.status(result.status).send(result.data);
     }else{
        console.log(result.data.features);
        response.status(200).send(result.data.features);
     }
  }catch(error){
     response.status(500).send(error);
 }

});

then in my angular app, i make an http post request like this

searchLoation(query:any):Observable<any>{
  const url = 'https:XXXXXXXX/getApproximateAddress';
  return this.http.post(url,{place:query},{
    observe: 'body'
  });
}

the url is a different domain from where the request is coming from.

When i test everything in post man, everything works fine…

Source: Angular Questions