Member-only story

Handle CORS in Golang

Akash Jain
3 min readOct 10, 2020

--

CORS stands for Cross-Origin Resource Sharing, it’s a mechanism that allow browser to access the content of other websites on their website. It adds security as it do not allow to access the content without the consent of author.

Above image depicts that browser runs a website example.com and requested for content from api.example.com which is a different server but the request got blocked because of CORS Policy due to which the browser will show below mentioned error in their console.

How will the browser identify that the domains are different?

So, here’s the answer to your question, when the domain have,

To see content of different domain, we need to follow these points.

  1. Either we need to disable security issue from browser so that it doesn’t check for…

--

--

Akash Jain
Akash Jain

Written by Akash Jain

Love to write code and discuss technology | If you explain to others in simple words it means you know it very well — akashjain132@gmail.com

No responses yet