Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Enable CORS support in Qt + Webkit based application on Windows.

    Qt WebKit
    1
    1
    3081
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      samirsha last edited by

      Hello Everyone,

      I got CORS (Cross-Origin Resource Sharing) working with Qt 4.7.1 + webkit on server side with appropriate headers as per CORS spec. Essentially, I have need to submit login form HTTP POST to different origin (though same domain) which in turn issues HTTP 302 GET Redirect. I setup my XHR request such that

      1. It is synchronous call instead of async.
      2. WithCredentials flag is set to true
      3. Allow-Access-Control-Origin is set up in Apache to the allow the source origin
      4. I have allowed various headers and credentials from Apache server side.

      While pre-flight request OPTIONS and POST seems to be successful, the webkit's XHR issues status = 0 (error).

      Question:
      Since webkit issues this error, I am wondering if I can enable any settings in Qt so that cross origin is supported inherently without us needing to do steps above. Our application is in a way sand-boxed such that we go to specific domain. It is not open browsing.

      If there is no setting like that, workaround is ugly. We have to catch status = 0 and readyState = 4 statuses and consider that XHR is successful and move on to rest of business logic.

      Any help would be appreciated.

      1 Reply Last reply Reply Quote 0
      • First post
        Last post