jquery 'Request header field token is not allowed by Access-Control-Allow-Headers'



我正在通过AJAX上传文件。但是,我遇到了这个错误:

Request header field token is not allowed by Access-Control-Allow-Headers

这是我要上传到网站的响应标题,响应标题似乎都很好:

HTTP/1.1 200 OK
Access-Control-Allow-Headers: X-Requested-With, X-Prototype-Version, Content-Disposition, Cache-Control, Content-Type
Access-Control-Allow-Methods: POST, GET, OPTIONS
Access-Control-Allow-Origin: http://admin.lvho.st:9292
Access-Control-Max-Age: 1728000
Cache-Control: no-cache
Content-Encoding: gzip
Content-Type: text/plain; charset=utf-8
Date: Wed, 22 Jan 2014 03:01:25 UTC
Server: cloudinary
Status: 200 OK
X-Request-Id: 3a74ab61f56ae7620c8ffbb5440b75b6
X-UA-Compatible: IE=Edge,chrome=1
transfer-encoding: chunked
Connection: keep-alive

这是请求标题:

OPTIONS /v1_1/*****/image/upload HTTP/1.1
Host: api.cloudinary.com
Connection: keep-alive
Cache-Control: no-cache
Pragma: no-cache
Access-Control-Request-Method: POST
Origin: http://admin.lvho.st:9292
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36
Access-Control-Request-Headers: accept, token, content-type
Accept: */*
Referer: http://admin.lvho.st:9292/venue/
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8

响应标题中是否有些缺少/错误?

谢谢

在响应前(选项)中,访问控制的标题(选项)缺少对"令牌"标头的引用。您将需要更新服务器响应以考虑此标题。

相关内容

最新更新