What is Cross-Origin Resource Sharing? Resolve CORS Error in React NodeJS Express Application

Описание к видео What is Cross-Origin Resource Sharing? Resolve CORS Error in React NodeJS Express Application

What is a Cross-Origin Resource Sharing (CORS) Error? How to fix CORS in react, nodejs (express), and javascript applications.

CORS is a security mechanism enforced by web browsers to control how two origins (or web servers) share resources. It allows the web server (or origin) to specify which other
origins can access its resources using HTTP headers.

CORS headers are Access-Control-Allow-Origin, Access-Control-Max-Age, Access-Control-Allow-Credentials, Access-Control-Allow-Headers, Access-Control-Allow-Methods, Access-Control-Expose-Headers.

00:00 CORS Intro
02:52 What is Origin?
06:45 How CORS Works?
12:18 Allowed Origin CORS Header
19:50 Allowed Headers
21:00 Max Age Header
23:00 Credentials Allowed Header
30:00 CORS Vs XSS
32:10 Browsers Enforce CORS
34:32 CORS Summary

CORS Demo Repo:- https://github.com/TrickSumo/learning...

Commands Used in video:- https://github.com/TrickSumo/learning...

CORS Documentation:- https://developer.mozilla.org/en-US/d...
Same Origin Policy:- https://developer.mozilla.org/en-US/d...
CORS AWS Documentation:- https://aws.amazon.com/what-is/cross-....

127.0.0.1/:1 Access to fetch at 'http://localhost:3000/' from origin 'http://127.0.0.1:5500' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

#CORS #webdevelopment #react #nodejs #javascript #Chrome

Комментарии

Информация по комментариям в разработке