Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/csharp-4.0/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google chrome 服务器响应后Chrome不发送主请求204_Google Chrome_Cors_Preflight - Fatal编程技术网

Google chrome 服务器响应后Chrome不发送主请求204

Google chrome 服务器响应后Chrome不发送主请求204,google-chrome,cors,preflight,Google Chrome,Cors,Preflight,这是我的nginx配置: add_header 'Access-Control-Allow-Origin' '*'; add_header 'Access-Control-Allow-Methods' '*'; add_header 'Access-Control-Max-Age' 1728000; add_header 'Access-Control-Allow-Credentials' 'true'; add_header 'Access-Control-All

这是我的nginx配置:

   add_header 'Access-Control-Allow-Origin' '*';
   add_header 'Access-Control-Allow-Methods' '*';
   add_header 'Access-Control-Max-Age' 1728000;
   add_header 'Access-Control-Allow-Credentials' 'true';
   add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range,Authorization,Lang';
   add_header 'Content-Length' 0;
   add_header 'Content-Type' 'text/plain charset=UTF-8';
   return 204;
Chrome收到了来自nginx的204响应,但它没有发送主请求

我在firefox中测试了相同的请求,它是好的,而chrome不是

谢谢你的帮助

PS:nginx日志: chrome的请求:

192.168.10.172 - - [20/Mar/2017:15:32:40 +0800] "OPTIONS /api/1.0/workflow/project/53469591758c77e464b9504040842886/process-variable/jtxmmc_select/execute-query HTTP/1.1" 204 0 "https://wf.sxvtc.com/sysworkflow/zh/neoclassic/cases/cases_Step?TYPE=DYNAFORM&UID=85519901758c8db854092e8090509883&POSITION=2&ACTION=EDIT" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.98 Safari/537.36" "-"
Firefox的请求:

192.168.10.172 - - [20/Mar/2017:15:32:02 +0800] "POST /api/1.0/workflow/project/53469591758c77e464b9504040842886/process-variable/jtxmmc_select/execute-query HTTP/1.1" 200 2594 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Firefox/52.0" "-"

我不明白为什么chrome发送选项方法和firefox没有

请发布发出请求的JavaScript客户端代码