HTTP/1.1 200 OK
Date: Wed, 24 Sep 2014 16:06:12 GMT
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: Thu, 01 Jan 1970 00:00:00 GMT
X-Frame-Options: DENY
Access-Control-Allow-Methods: GET, PUT, POST, OPTIONS, DELETE
Access-Control-Max-Age: 3600
Access-Control-Allow-Headers: Access-Control-Allow-Headers: Origin, Authorization, X-Requested-With, Content-Type, Accept
Access-Control-Allow-Credentials: true
Set-Cookie: JSESSIONID=eyv8cpnnfphy1b0121uzt293y;Path=/
Content-Length: 0
Server: Jetty(9.2.2.v20140723)
Angular的请求设置如下:
$http.get(AS_API_URL + '/provisioning/users/current-user', {
headers: {
'Authorization': 'Basic ' + base64EncodedAuth
}
});
由于某种原因,这些标头在Chrome中运行良好,但在Firefox中却无法正常工作,是否有人知道原因?我需要提供更多信息吗?
编辑:
Musa正确指出Access-Control-Allow-Headers格式不正确。 我编辑了Jetty Server,使标头现在读作:
Access-Control-Allow-Headers: Origin, Authorization, X-Requested-With, Content-Type, Accept
我要感谢你,Musa,你刚刚帮我解决了问题 :)
Access-Control-Allow-Headers
头部似乎格式不正确。 - Musa