Microsoft Edge CORS声称"请求方法PATCH在Access-Control-Allow-Methods列表中没有出现"即使它是

时间:2018-05-09 11:33:48

标签: cors microsoft-edge

我正在测试MS Edge中的Web应用程序,它向我们的API发出PATCH请求。 Edge发送以下预检OPTIONS请求:

Accept: */*
Accept-Encoding: gzip, deflate, br
Accept-Language: en-GB
Access-Control-Request-Headers: authorization,content-type
Access-Control-Request-Method: PATCH
Cache-Control: no-cache
Connection: Keep-Alive
Content-Length: 0
Host: https://api.my.site
Origin: https://app.my.site
Referer: http://app.my.site
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 Edge/16.16299

我们的API服务响应:

Access-Control-Allow-Headers: Authorization, Content-Type
Access-Control-Allow-Methods: GET, POST, PUT, PATCH
Access-Control-Allow-Origin: *
Cache-Control: no-cache
Connection: close
Content-Length: 0
Content-Type: text/plain
Date: Wed, 09 May 2018 11:18:13 GMT
Server: Apache/2.4.7 (Ubuntu)
X-Powered-By: PHP/5.5.9-1ubuntu4.22

但是,MS Edge会阻止PATCH请求,引发以下错误:

  

SEC7124:请求方法PATCH在Access-Control-Allow-Methods列表中不存在。

尽管PATCH列在Access-Control-Allow-Methods标头中。我也遵循this question的指导,注意我在标题中没有使用*,只有一个Access-Control-Allow-Methods标题。

另请注意,此请求在最新版本的Chrome和Firefox中运行良好。

有关可能导致此错误的内容的任何想法?

0 个答案:

没有答案