W3C home > Mailing lists > Public > public-json-ld-wg@w3.org > April 2019

Re: Playground error or schema.org error?

From: Richard Wallis <richard.wallis@dataliberate.com>
Date: Fri, 5 Apr 2019 15:24:18 +0100
Message-ID: <CAD47Kz6R727gEK2NACMnyuQ-O8KfX65kqfBNRoXnuur3GawbRg@mail.gmail.com>
To: "David I. Lehn" <dil@lehn.org>
Cc: Pierre-Antoine Champin <pierre-antoine.champin@univ-lyon1.fr>, "Cole, Timothy W" <t-cole3@illinois.edu>, Ivan Herman <ivan@w3.org>, Dan Brickley <danbri@google.com>, Gregg Kellogg <gregg@greggkellogg.net>, W3C JSON-LD Working Group <public-json-ld-wg@w3.org>
The technical update, I mentioned, to the Schema.org site has now been
applied. It includes the change to apply the access-control-allow-origin: *

I am pleased to report that in the Playground all four combinations of
context URI (http://schema.org, https://schema.org, http://schema.org/,
https://schema.org/) now operate as expected.

Richard Wallis
Founder, Data Liberate
Linkedin: http://www.linkedin.com/in/richardwallis
Twitter: @rjw

On Thu, 4 Apr 2019 at 19:12, David I. Lehn <dil@lehn.org> wrote:

> On Thu, Apr 4, 2019 at 12:03 PM Pierre-Antoine Champin <
> pierre-antoine.champin@univ-lyon1.fr> wrote:
>> The only URL that works for me in the playground is "http://schema.org",
>> and this is indeed because it does *not* query the original URL, but
>> instead:
>> https://json-ld.org/playground/proxy.php?url=http://schema.org
>> For any other variant, the original URL is requested,
>> and the console displays a Cross-Origin Request error message on the 2nd
>> request
>> (i.e. after the succesful redirection).
>> This is *definitely* related to the fact that
>>     https://schema.org/docs/jsonldcontext.json
>> is missing the header
>>     access-control-allow-origin: *
> To clarify some of the odd playground behavior, there is a hack in there
> [1] to handle "http://schema.org/" (with the trailing slash).  It will
> rewrite to https to avoid mixed security issues.  Any other urls that are
> not https will use the proxy, including "http://schema.org" (w/o the
> trailing slash).  That code should really change all schema.org urls to
> https.  An oversight that it didn't do that before, but at the moment a fix
> would break the version w/o trailing slash.  It does appear that when not
> using the proxy it's just a CORS issue.  It would be nice to fallback to
> the proxy if CORS fails, but I don't think there is a way to detect that is
> the cause of a failure.
> [1]
> https://github.com/json-ld/json-ld.org/blob/master/playground/playground.js#L1498
> -dave
Received on Friday, 5 April 2019 14:24:54 UTC

This archive was generated by hypermail 2.3.1 : Friday, 5 April 2019 14:24:55 UTC