Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

jquery - XMLHttpRequest - SEC7127: Redirect was blocked for CORS request

I am getting below error when I visit our webpage first time on IE11. It works in Chrome on my machine but doesn't work on other developer's machine. But it works when page is refreshed in all cases.

Error is

SEC7118: XMLHttpRequest for https://secure.server.com/esi?isie789=n&_=1403623253418 required Cross Origin Resource Sharing (CORS).

SCRIPT7002: XMLHttpRequest: Network Error 0x2ef1, Could not complete the operation due to error 00002ef1. SEC7127: Redirect was blocked for CORS request.

It is being called using Ajax jquery.

    $.ajax({
        url: esiUrl,
        type: 'GET',
        data: "isie789=" + isIE789,
        dataType: 'html',
        cache: false,
        success: function(responseText) {
            if(responseText.length > 0) {
                $("#deal-of-day-esi").replaceWith(responseText);
            }
        },
        error: function() {
        }
    });

Looking into to request/response headers in IE11 - I don't see any. But on refresh or in Chrome, Firefox we do see response headers with Below values

Access-Control-Allow-Credentials:true Access-Control-Allow-Origin:http://www.server.co.uk

Can you please help.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I can't find this documented anywhere, but in my testing it appears that:

XMLHttpRequest: Network Error 0x2ef1

specifically refers to a mixed mode error; for example when an https site serves a request to redirect to an http site.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...