CORS测试工具,跨域测试
2code
var xhr = new XMLHttpRequest();
xhr.open('GET',"https://xhf.monxin.com/file/14486/program/slider/img/345.jpg");
xhr.send(null);
xhr.onload = function(e) {
var xhr = e.target;
console.log(xhr.responseText);
}
	
3ng
  add_header 'Access-Control-Allow-Origin' '*';
    add_header 'Access-Control-Allow-Methods' '*';
    
    add_header 'Access-Control-Allow-Headers' '*';
   add_header 'Access-Control-Request-Headers' '*';
    if ($request_method = 'OPTIONS') {
    #	return 204;
    }
	
4apche 图片
80 及443配置下 写 
Header set Access-Control-Allow-Origin *  
5apche 全部
    
    # 允许的HTTP方法
    Header set Access-Control-Allow-Methods *
    
    # 允许的请求头
    Header set Access-Control-Allow-Headers *
    Header set Access-Control-Request-Headers *
	
本页由《梦行文档》生成

 

name完成
30