Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt WebKit
  4. Enable CORS support in Qt + Webkit based application on Windows.

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

Scheduled Pinned Locked Moved Qt WebKit
1 Posts 1 Posters 3.3k Views
  • 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 Offline
    S Offline
    samirsha
    wrote on last edited by
    #1

    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
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved