【问题标题】:Angular cross-domain request works on Chrome, fails on Firefox and IEAngular 跨域请求在 Chrome 上有效,在 Firefox 和 IE 上失败
【发布时间】:2015-07-31 15:48:30
【问题描述】:

我的 Angular 应用通过 Apache 的跨域请求在 Google Chrome 上运行,但在 Firefox 上失败并出现 Error: a security problem occurred 错误。

这是我的Django 应用程序的Apache 配置:

    <Location />  
            Header always set Access-Control-Allow-Origin http://stage.myangularsite.com
            Header always set Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE, PUT"
            Header always set Access-Control-Max-Age "1000"
            Header always set Access-Control-Allow-Credentials: true
            Header always set Access-Control-Allow-Headers "x-requested-with, Content-Type, origin, authorization, authentication, accept, client-security-token"
            Header always set Access-Control-Request-Headers "x-requested-with, Content-Type, origin, authentication, client-security-token"

            AuthType Basic
            AuthName "Authentication Required"
            AuthUserFile "/home/user/.htpasswd" 
            Require valid-user
    </Location>

仅供参考,在接收应用程序上,我使用的是 django-cors-headersdjango-rest-framework

【问题讨论】:

    标签: angularjs django django-cors-headers


    【解决方案1】:

    我认为您正在寻找的是xDomain Library

    你可以在这个问题上找到一些关于它的信息:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-05-07
      • 2012-03-18
      • 2013-10-24
      • 2017-08-15
      • 1970-01-01
      • 2021-02-19
      • 1970-01-01
      • 2013-07-24
      相关资源
      最近更新 更多