问题
I've recently started delegating to a CDN-hosted jquery, forgetting about my ajax calls being impacted by CORS -- oops. Surprisingly, we haven't seen browsers making much fuss about it! Specifically, as far as we can tell only one particular browser does a preflight OPTIONS (the agent is "Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0"). Vast majority of browsers out there, including Chrome, FF or Safari are perfectly happy without the preflight -- one of the reasons why we didn't catch the problem in development/testing, that our OPTIONS request handling was lacking.
Please confirm if this scenario does in fact constitute CORS:
- file: app.js from Host-A
- file: jquery.js from CDN
app.js makes ajax-calls to its place of origin (Host-A) using jquery from CDN. Is IE11 the only one doing it right by issuing the preflight?
Thanks!
回答1:
All ajax-calls have the origin Host-A. They have the origin of the domain of the original html document.
来源:https://stackoverflow.com/questions/27366200/when-jquery-comes-from-cdn-are-ajax-calls-cross-origin