【发布时间】:2015-12-24 01:43:22
【问题描述】:
简单请求是满足以下条件的请求:
-
HTTP 方法匹配(区分大小写)以下之一:
- 头
- 获取
- 发布
-
HTTP 标头匹配(不区分大小写):
- 接受
- 接受语言
- 内容-语言
- 最后一个事件 ID
- Content-Type,但仅当值为以下之一时:
- application/x-www-form-urlencoded
- 多部分/表单数据
- 文本/纯文本
但是看看这个test page 并没有引起 preflight 请求:
一般:
Remote Address:69.163.243.142:80
Request URL:http://aruner.net/resources/access-control-with-get/
Request Method:GET
Status Code:200 OK
请求标头
Accept:*/*
Accept-Encoding:gzip, deflate, sdch
Accept-Language:en-US,en;q=0.8,he;q=0.6
Cache-Control:no-cache
Connection:keep-alive
DNT:1
Host:aruner.net
Origin:http://arunranga.com
Pragma:no-cache
Referer:http://arunranga.com/examples/access-control/simpleXSInvocation.html
User-Agent:Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36
响应标头
Access-Control-Allow-Origin:http://arunranga.com
Connection:Keep-Alive
Content-Type:application/xml
Date:Sat, 26 Sep 2015 09:00:26 GMT
Keep-Alive:timeout=2, max=100
Server:Apache
Transfer-Encoding:chunked
书呆子看着request部分,前面的标准部分中有很多不是的标题:
-
Cache-Control不在列表中 -
Connection不在列表中 -
DNT不是不在列表中 -
User-Agent不在列表中 -
Accept-Encoding不在列表中
我知道这些更多的是“通用”标题。 但是accept-language
问题
我在这里缺少什么?根据标准部分,带有这些标头的请求应该引起预检请求。
【问题讨论】:
标签: http http-headers cors preflight