header('Access-Control-Allow-Origin: *'); Not allowing CORS request

前端 未结 3 1290
醉酒成梦
醉酒成梦 2021-02-06 06:45

I have a PHP file which generates a JSON document.

I\'ve set the header as follows but am still getting an error.

header(\'Access-Control-Al         


        
3条回答
  •  清歌不尽
    2021-02-06 07:20

    Such a situation may arise when an error occurs on the requested page. In this case the error page sets headers, that likely has no Access-Control-Allow-Origin header.

提交回复
热议问题