Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-84888

XMLHttpRequest.status always 0 in wasm

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P2: Important P2: Important
    • None
    • 5.15.0
    • None
    • WebAssembly

      My JS/QML code makes a simple XMLHttpRequest like this:

      var xhr = new XMLHttpRequest();
      xhr.onreadystatechange = () => {
          if (xhr.readyState === 4) {
              // here I examine xhr.status
          }
      };
      xhr.open("GET", "https://somewhere", true);
      xhr.responseType = "json";
      xhr.send(null);
      

      Which works great on desktop Linux, but when compiled for WebAssembly, xhr.status is always 0 inside the if condition in the code.

      Other values (such asĀ xhr.responseText) are set correctly.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            lpotter Lorn Potter
            lubosd Lubos Dolezel
            Veli-Pekka Heinonen Veli-Pekka Heinonen
            Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes