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

Local scheme (qrc or file) can not connect to remote server

    XMLWordPrintable

Details

    • All

    Description

      A http request issued from a local scheme like qrc is blocked because of CORS (cross-origin-resource-sharing) restriction. We expect the local scheme is not considered as cross-origin.

      Attached is a repro Qt project based in example webui. It tests qrc, customized/registered scheme, and file scheme, was built and run with Qt5.15.9 and 6.3.1.

      • the user defined scheme can NOT be qrc as it's an internal scheme
      • even with user defined scheme (loc in the repro), the http request will be blocked.
        • js: Access to XMLHttpRequest at 'https://www.google.com/' from origin 'loc:' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
      • the file scheme is working in 5.15.9 but failing with 6.3.1 in this repro. 
      • likely the same issue as https://bugreports.qt.io/browse/QTBUG-76258. bur workaround didn't work anymore.
      • per our investigate, this issue is also related to Chromium SameSiteByDefaultCookie flag

      Attachments

        Issue Links

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

          Activity

            People

              allan.jensen Allan Sandfeld Jensen
              ying.peng Ying Peng
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes