ทุกคนคงเคยเจอกับ error cors แต่โดยปกติ เราก็จะ allow * กัน 555
มันจะดีกว่าไหม ถ้าเรารู้จริงๆว่าโปรแกรมต้องการอะไร!!!
Access to XMLHttpRequest at ‘http://localhost:1323/api/users’ 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.
หรือ
Access to XMLHttpRequest at ‘http://localhost:1323/api/users’ from origin ‘http://localhost:4200’ has been blocked by CORS policy: Request header field content-type is not allowed by Access-Control-Allow-Headers in preflight response.

นั้นหมายความว่า เราต้องเพิ่ม
echo.HeaderAuthorization
echo.HeaderContentType

