Open davidlehn opened 1 year ago
Note to future self:
I think you can probably white-list the proxy to only work with schema.org and that will handle 99% of cases involving redirection or HTTP headers. Of course, it's good practice to handle common requests locally to avoid web traffic, but that requires some mechanism to keep the local versions up to date. But, IIRC jsonld.js has a way to use a local cache of loaded contexts.
The playground rewrites schema.org specifically to always be https, so the proxy isn't even used for that. (At least not for the common base domain URL use case).
The playground has a proxy to help load HTTP contexts from the HTTPS playground: https://github.com/json-ld/json-ld.org/blob/main/playground/proxy.php
There are some issues with this:
Ideally the proxy would not be needed, but if the playground is to be HTTPS, then a workaround to load HTTP resources is needed.
I think the longer term fixes that are needed are:
See also: https://github.com/json-ld/json-ld.org/issues/798