Firefox忽略了CORS方法

时间:2016-07-27 10:53:20

标签: ajax firefox cors

我正在实施支持CORS的Web服务。一切正常,除非我发出DELETE请求。 Firefox发送以下预检:

OPTIONS /node-configuration?sessionId=cee013ce-53e6-11e6-8929-7efd7b6db237&address=127.0.0.1&port=8043 HTTP/1.1
Host: 127.0.0.1:8032
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Access-Control-Request-Method: DELETE
Origin: XXX
Connection: keep-alive

服务器响应:

HTTP/1.1 200 OK
Content-Length: 0
Strict-Transport-Security: max-age=31536000; includeSubDomains
Access-Control-Allow-Origin: XXX
Access-Control-Allow-Method: POST, GET, DELETE, OPTIONS

如您所见,DELETE位于Access-Control-Allow-Method标头中。但是当我发送请求时:

DELETE /node-configuration?sessionId=cee013ce-53e6-11e6-8929-7efd7b6db237&address=127.0.0.1&port=8043
Accept: application/json, text/plain, */*
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.5
Connection: keep-alive
Host: 127.0.0.1:8032
Origin: XXX
Referer: XXX
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0

Firefox阻止它:在CORS“Access-Control-Allow-Methods”中找不到方法

我错过了什么吗?

1 个答案:

答案 0 :(得分:1)

标题名为Access-Control-Allow-Methods,您错过了响应标题末尾的s