Chao Yang

Nothing seek, nothing find


  • Home

  • Minibooks

  • Projects

  • Résumé

  • Archive

  • About

  • Search
close

CORS revisit

Published at: 2018-03-24   |   Categories: Web     |   Reading: 138 words ~1min

Origin

The issue stems from the same-origin policy which forces the browsers to restrict the resource access of a different origin (e.g. different domain) when: - AJAX request - Web Fonts (for cross-domain font usage in @font-face within CSS) - Images/video frames drawn to a canvas using drawImage. - Stylesheets (for CSSOM access). - others

CORS is a technique for relaxing the same-origin policy and similar techniques include JSONP, or server-side proxy which were used in the past.

Handling simple CORS request

In the simplest scenario, cross-origin communications don’t need preflight requests when satisfying the following: - GET, POST, HEAD - content type of a POST request is: application/x-www-form-urlencoded, multipart/form-data, text/plain - Origin header

Then the server will consider the request’s Origin and either allow or disallow the request. If allowing, then it will respond with: - Access-Control-Allow-Origin

#Web#
Notes - CSS in Depth
微信扫一扫交流

标题:CORS revisit
作者:Chao
关注:richdyang(CHAO)
声明:自由转载-非商用-非衍生-保持署名(创作共享3.0许可证)

  • Table of Content
  • Site Information
Chao

Chao

Programmer & Life explorer

138 Blogs
49 Categories
20 Tags
GitHub Linkedin
  • Origin
  • Handling simple CORS request
© 2009 - 2018 Chao Yang
Powered by - Hugo v0.30.2
Theme by - NexT