golang gin 中 Access-Control-Allow-Origin 为* 无效 Response to preflight request doesn't pass access ...

请求显示:

Response to preflight request doesn't pass access control check: It does not have HTTP ok status

这个问题看起来像跨域,其实并不是,而是说 option 没有反馈状态

golang gin框架中,并没有直接处理,
option中没有状态反馈也不行,如图,加入这个反馈即可


image.png

你可能感兴趣的:(golang gin 中 Access-Control-Allow-Origin 为* 无效 Response to preflight request doesn't pass access ...)