C# vue 跨域405(Method Not Allowed)问题

zepot post没有问题,用plupload上传出现了这个错误,options过不去。显示Response for preflight has invalid http status code 405

在global中处理下option

 protected void Application_BeginRequest()
        {
            if (Request.Headers.AllKeys.Contains("Origin") && Request.HttpMethod == "OPTIONS")
            {
                Response.End();
            }
        }

另外,还要注意header的设定。多个允许的自定义header逗号隔开。不然也会被拒绝。


      
        
        
        
      
    

 

你可能感兴趣的:(.net,mvc,技术)