Re: Playground error or schema.org error?

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: *
 header.

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
Richard Wallis
Founder, Data Liberate
http://dataliberate.com
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