另一个关于CORS的问题,我查看了很多信息,但是仍然无法解决。所以,我将非常感谢您的帮助。
我正在发送启用凭据的fetch请求。浏览器通常会在Access-Control-Allow-Credentials上发出警告。我尝试配置代理,但它也无法解决问题。因此,我需要在服务器响应设置中添加Access-Control-Allow-Credentials。但是我不知道该如何实现。
我正在使用create-react-app。甚至没有熟悉的服务器代码文件。
错误:
我正在发送启用凭据的fetch请求。浏览器通常会在Access-Control-Allow-Credentials上发出警告。我尝试配置代理,但它也无法解决问题。因此,我需要在服务器响应设置中添加Access-Control-Allow-Credentials。但是我不知道该如何实现。
我正在使用create-react-app。甚至没有熟悉的服务器代码文件。
错误:
The value of the 'Access-Control-Allow-Credentials' header in the response is ''
which must be 'true' when the request's credentials mode is 'include'
响应头:
access-control-allow-origin: http://localhost:3000
请求头:
WARNING Provisional headers are shown
Access-Control-Request-Headers: access-control-allow-credentials,access-control-allow-origin
Access-Control-Request-Method: GET
Origin: http://localhost:3000
Referer: http://localhost:3000/
Access-Control-Allow-Credentials
具有有效值,但错误消息说响应的值是''。哪一个是正确的? - Panther