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

XMLHttpRequest.status always 0 in wasm

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 5.15.0
    • Fix Version/s: None
    • Labels:
      None
    • Platform/s:
      WebAssembly

      Description

      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.

        Attachments

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

          Activity

            People

            Assignee:
            lpotter Lorn Potter
            Reporter:
            lubosd Lubos Dolezel
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes