Closed jamescummings closed 1 year ago
Another workaround might be to use the dedicated host/subdomain https://vault.tei-c.org which serves the same content as https://tei-c.org/Vault from a different – CORS-enabled – server.
Workarounds like using Jenkins
or vault.tei
are fine. They work well. And that is what we have been doing.
The issue is that LEAF-Writer is a web editor; it only works on the browser without the need or reliance on a server. It relies on the schema declaration of a document to retrieve the schema file.
Sure, we can manipulate the URI, but it defeats the purpose of linked data. I mean, the XLM points to a specific schema (and perhaps to a specific version of a schema). Why would the editor get it elsewhere if the schema is publicly available in the URI?
The solution we implemented involved alternative routes to get the schema. First, we try the URI in the file (e.g., from tei-c
). If it fails, we try to get it from Jenkins
.
Unless there is a good reason to block the browser from fetching schemas from tei-c
, I believe this is an easy technical problem to solve.
I had a look at the web server configuration and the Vault at https://tei-c.org/Vault/ already has CORS enabled. I do not see any reason why /release
shouldn't have CORS enabled too so I will go ahead and add it.
Done. @lucaju / @jamescummings can you please try again and close the issue if successful?
@peterstadler . Thank you for doing this.
Not sure if I a doing something wrong, but the request is still be blocked by CORS.
To be more specific, and give an example, people have document point to this schema: https://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_all.rng
I attached an image so you can see the error we are getting. I don't know if helps, but you can see it by yourself if you follow this link: https://leaf-writer.leaf-vre.org/edit?sample=Sample%20TEI%20letter (open the console to see the error).
@lucaju Try it again. There was another location directive in our config that was interfering.
Looks good to me now (tested with https://leaf-writer.leaf-vre.org/edit?sample=Sample%20TEI%20letter)
Thanks @hcayless
Perfect. It is working for me too. Thank you @peterstadler
External systems trying to use off-the-shelf TEI-C schemas often have difficulty because some resources can be blocked by CORS. For example, a GitLab issue on LEAF-Writer Luciano Frizzera @lucaju points out:
Is there a way we can enable other systems grabbing TEI schemas easily? What is needed to do so? The current work-around is to get them from Jenkins (presumably the stable TEI P5 release versions), but that seems less than optimal.