当我在本地主机上尝试我的项目时,由于CORS问题,使用https://cors-anywhere.herokuapp.com/它表现良好。但是一旦我将网站部署到Netlify上,使用或不使用https://cors-anywhere.herokuapp.com/都会给我错误426(需要升级)。这些是出现在我的控制台上的消息:
>Failed to load resource: the server responded with a status of 426 (Upgrade Required)
>Error: Request failed with status code 426
at createError.js:16
at settle.js:17
at XMLHttpRequest.<anonymous> (xhr.js:61)
我一直在搜索,有些人似乎遇到了类似的问题。我看到了一些解决方案,比如拥有自己的服务器来传递请求,但我不知道如何操作,如果我错了,请纠正我,那难道不与使用https://cors-anywhere.herokuapp.com/相同吗?