“Origin null is not allowed by Access-Control-Allow-Origin” error for request made by application running from a file:// URL

后端 未结 17 1415
孤城傲影
孤城傲影 2020-11-21 04:42

I\'m developing a page that pulls images from Flickr and Panoramio via jQuery\'s AJAX support.

The Flickr side is working fine, but when I try to $.get(url, ca

17条回答
  •  不思量自难忘°
    2020-11-21 05:19

    As final note the Mozilla documentation explicitly says that

    The above example would fail if the header was wildcarded as: Access-Control-Allow-Origin: *. Since the Access-Control-Allow-Origin explicitly mentions http://foo.example, the credential-cognizant content is returned to the invoking web content.

    As consequence is a not simply a bad practice to use '*'. Simply does not work :)

提交回复
热议问题