W3C home > Mailing lists > Public > public-linked-json@w3.org > March 2017

Re: cors error when loading json files

From: Brent Shambaugh <brent.shambaugh@gmail.com>
Date: Thu, 23 Mar 2017 12:30:36 -0500
Message-ID: <CACvcBVqu59_cfmKKmHNHPgSDQLGk_Rk9naZzBqsgEmr0aKASNw@mail.gmail.com>
To: Linked JSON <public-linked-json@w3.org>
FYI:

The network log is more like:

GET
XHR
http://localhost/node-arc-d3/data/johnlennon.json [HTTP/1.1 304 Not
Modified 1ms]
GET
XHR
http://json-ld.org/contexts/person.jsonld [HTTP/1.1 200 OK 292ms]
Cross-Origin Request Blocked: The Same Origin Policy disallows reading
the remote resource at http://json-ld.org/contexts/person.jsonld.
(Reason: CORS header ‘Access-Control-Allow-Origin’ does not match ‘*,
*’).  (unknown)
TypeError: input is undefined[Learn More]  bun2-exportN3.js:418:11

Thus it loads:

{
  "@context": "http://json-ld.org/contexts/person.jsonld",
  "@id": "http://dbpedia.org/resource/John_Lennon",
  "name": "John Lennon",
  "born": "1940-10-09",
  "spouse": "http://dbpedia.org/resource/Cynthia_Lennon"
}

but then it fails to load http://json-ld.org/contexts/person.jsonld
(which exists, it just does not have a matching header for CORS)

This causes the next script which needs the result to fail..





-Brent Shambaugh

GitHub: https://github.com/bshambaugh
Website: http://bshambaugh.org/
LinkedIN: https://www.linkedin.com/in/brent-shambaugh-9b91259
Skype: brent.shambaugh
Twitter: https://twitter.com/Brent_Shambaugh


On Thu, Mar 23, 2017 at 12:13 PM, Brent Shambaugh
<brent.shambaugh@gmail.com> wrote:
> Is this quite expected with json-ld files, such as the example at json-ld.org?
>
> Cross-Origin Request Blocked: The Same Origin Policy disallows reading
> the remote resource at http://json-ld.org/contexts/person.jsonld.
> (Reason: CORS header ‘Access-Control-Allow-Origin’ does not match ‘*,
> *’).  (unknown)
>
> -Brent Shambaugh
>
> GitHub: https://github.com/bshambaugh
> Website: http://bshambaugh.org/
> LinkedIN: https://www.linkedin.com/in/brent-shambaugh-9b91259
> Skype: brent.shambaugh
> Twitter: https://twitter.com/Brent_Shambaugh
Received on Thursday, 23 March 2017 17:31:10 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:18:49 UTC