CORS (Cross-Origin Resource Sharing) একটি ব্রাউজার নিরাপত্তা ব্যবস্থা যা নিয়ন্ত্রণ করে যে একটি origin থেকে একটি ওয়েব পৃষ্ঠা একটি ভিন্ন origin-এ একটি সার্ভারে অনুরোধ করতে পারে কিনা। ডিফল্টরূপে, ব্রাউজার cross-origin অনুরোধগুলি ব্লক করে; সার্ভারকে অবশ্যই প্রতিক্রিয়া হেডারগুলির মাধ্যমে সেগুলি স্পষ্টভাবে অনুমতি দিতে হবে।
একই-origin নীতি এবং সমস্যা
Origin = scheme + host + port. These are DIFFERENT origins:
https://app.example.com → https://api.example.com (different host)
http://localhost:3000 → http://localhost:4000 (different port)
Browser blocks the cross-origin request UNLESS the server sends CORS headers allowing it.
