cross origin problems with extjs 6.01

前端 未结 3 1520
一生所求
一生所求 2020-12-22 09:46

I\'m using a POST form to login on my backend which works without any problem. The backend accepts all locations (*)

After I login, I\'m ready to get some data and t

相关标签:
3条回答
  • 2020-12-22 10:27

    I would suggest you to use Ext.data.JsonP.request instead of Ext.Ajax.request.

    JSONP by definition from wiki

    is a technique used by web developers to overcome the cross-domain restrictions imposed by browsers' same-origin policy that limits access to resources retrieved from origins other than the one the page was served by

    Here is the documentation

    0 讨论(0)
  • 2020-12-22 10:36

    I am sure you already know that JavaScript is case-sensitive; but did you know that Headers are, too?

    The browser states correctly that Access-Control-Allow-Origin is not *, because Access-Control-Allow-Origin and access-control-allow-origin are two different headers - and only one of them is a valid CORS header.

    0 讨论(0)
  • 2020-12-22 10:41

    We solved this issue:

    • installed corsEverywhere firefox plugin to simulate an accepted cors so we could compare settings with/without simulation:

    • Access-Control-Allow-Credentials true wasn't set at the server. ( cookie authentication )

    • server ( Microsoft-IIS/7.5 ) didn't like * so we set remote site name explicit
    • removed trailing / in sitename

    works

    0 讨论(0)
提交回复
热议问题