跨源请求在同一主机URL上被阻止

时间:2015-11-16 02:41:01

标签: javascript

在我的javascript中我有

client.base_url = "https://qp-t3.herokuapp.com";

var url = client.base_url + "/account/new?name=" + client.name;

    http.get({
        url: url,
        onload: function() { 
            account = JSON.parse(this.responseText);
            client.account = account;
            client.findGame();
        }
        });
}

我收到此错误:

XMLHttpRequest cannot load https://qp-t3.herokuapp.com/account/new?name=rstrsrtsrt. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://qp-t3.herokuapp.com' is therefore not allowed access.

我看到了,因为我发送了http。我正在使用http.min.js。

如何发送https?

编辑:http.min.js库,当我用该基本URL调用http.get时,转换为HTTP。

我会尝试使用:// trick

Mixed Content: The page at 'https://qp-t3.herokuapp.com/' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://qp-t3.herokuapp.com/account/new?name=v'. This request has been blocked; the content must be served over HTTPS.

0 个答案:

没有答案