XMLHttpRequest incorrectly reports status 0

Confirmed Issue #14407632 • Assigned to Venkat K.

Details

Author
André R.
Created
Oct 27, 2017
Privacy
This issue is public.
Found in
  • Microsoft Edge
Found in build #
40.15063
Reports
Reported by 9 people

Sign in to watch or report this issue.

Steps to reproduce

On my page, I’m calling a web service using JQuery’s post method. This works in Chrome, Firefox and the latest Internet Explorer. However, in Edge, that exact same call reports status 0 (instead of 400, which would be correct), and fails. After some tests, I finally came to the conclusion that the error must lay somewhere in Edge itself, because it can be reproduced with a pure XMLHttpRequest.

Please visit this jQuery ticket for additional information and sample code.

Attachments

1 attachment

Comments and activity

  • Microsoft Edge Team

    Changed Assigned To to “James M.”

  • Hello,

    Thank you for providing this information about the issue. Unfortunately, we are unable to reproduce this problem in Edge with the information at hand. Please update this case when you can provide us with the API address or a full working sample to test.

    Best Wishes,
    The MS Edge Team

  • I experience the same behavior when I try to connect to a server on my local network.
    Edge doesn’t send the request and returns error 0. All other browsers, including IE11, send out the request and return the correct server response.

    The server on the local network is just a local copy of the remote server on the internet, but because Edge doesn’t even send the request, a server difference can’t be the issue. The only change I made to the request to make it work in Edge is the hostname, which I changed to a hostname that that points to an external IP (listed in DNS records). The server on the local network has its hostname listed in my hosts file.

  • Hello Erik,

    I was actually taken in by the fallacy, that I tested both sites locally. However, the "old version", where it worked, ran on one of our internal servers. After publishing my updated code to that server, it magically worked again.

    So the actual problem of this bug is, that XHR requests seem to don’t work when connecting to a server via localhost. Additionally, the error message is misleading, because it doesn’t state at all, why this happens. However, I think, if the first bug will get fixed, the second “imperfection” becomes irrelevant anyways.

  • Microsoft Edge Team

    Changed Assigned To to “Venkat K.”

    Changed Assigned To from “Venkat K.” to “Scott W.”

  • Do you have any news about this issue?

  • The error is at least still reproducible.

  • I’m experiencing the same issue, more in particular within an Edge extension which tries to communicate with a server on the LAN. This is a major issue for anyone trying to implement a business-level application where often internal servers are hosted in the LAN. Do you have any detailed plan about when this will be fixed?

  • This issue still existing in latest Edge browser. Do you have plan to fix this issue ?

  • Microsoft Edge Team

    Changed Status to “Confirmed”

    Changed Assigned To from “Scott W.” to “Venkat K.”

  • Any word on this. Or is there a work around?
    I am surprised it does not seem to be high priority

  • Here some more hints which may help to find the reason of the Bugs.
    The problem can be reproduced using only HTML and Javascript (based on pure XMLHttpRequest) - no jquery needed!

    1. Please use the attached HTML file above (edgebug.html) with a web Server, for example place it into the root directory of a server called "originserver".
    2. The HTML file let you specify an url which then is used by a button click to make an Ajax GET request to that url. When the readystatechanged, it is alerted.
    3. Then call that file from another web client node with the Edge browser, for example using the url “http://originserver/edgebug.html” and try ajax requests with different URLs: A:"http://localhost", B:"http://anotherNameForLocalhost", C:"http://originserver", D:"http://anotherserverDifferentFromLocalhost"
    4. You will see: in case A and B the Edge behaves buggy, in all other cases and all other Browsers like IE or Firefox (even for localhost) the behaviour is as expected. - The “Buggy” behaviour of the Edge is characterized in a missing readystatechange alert for state 4 for a long time (10 to 20 seconds), after waiting that time, the state 4 is alerted (but the server in the url had not been requested as expected, which you can find out for example with the developer Tools, fiddler, or similar)

    I made several interesting observations:

    1. The problem does only exist, if a cross-origin request is made (i.e. urls of the edgebug.html and the Ajax request are different) to the local host (i.e. the Ajax request url points to the host the Edge is running on).
    2. We have many different Windows-10-Workstations in our Company, and on some few the problem does NOT exist (i.e. Edge behaves like IE and other browsers). The differences of these Workstations are different Windows Updates!
      In particular: we have two Workstations with the SAME Windows Version 1803, the SAME Edge Version (and EDGE HTML Version), but they differ in the Edge’s behaviour - one Buggy, one as expected.
      So I think the Problem must be somewhere in the Network layer of Windows or in different Windows configurations/updates/Group policies.
  • Hi,

    We experienced the exact same issue, getting status 0 for CORS/localhost requests.

    Versions confirmed affected:

    Version #1
    Microsoft Edge 42.17134.1.0
    Microsoft EdgeHTML 17.17134

    Version #2
    Microsoft Edge 44.18362.267.0
    Microsoft EdgeHTML 18.18362

    We solved it for both these versions by running the following cmd in an elevated (administrator) cmd-window:

    CheckNetIsolation LoopbackExempt -a -n="Microsoft.MicrosoftEdge_8wekyb3d8bbwe"
    

    The browser doesn’t even need to be restarted. After this command is successfully run (should prompt OK), we get a 200 for the same request that was returning a 0.

    Hopefully this can be of help to others struggling with the same.

    Kind Regards,

    Eivind Roennevik

You need to sign in to your Microsoft account to add a comment.

Sign in