You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://www.w3.org/ns/hydra/core#title.
(Reason: header ‘if-modified-since’ is not allowed according to header ‘Access-Control-Allow-Headers’ from CORS preflight response).
It would be nice to disable any caching-related headers so I could avoid this issue. I tried passing {"if-modified-since": undefined} as the second argument to Hydra.loadResource, but no luck, this actually led to the issue occurring on more URLs.
The text was updated successfully, but these errors were encountered:
Actually, you can do that already by hooking to the Hydra.cacheStrategy.requestCacheHeaders function
It has a default value so you might decorate or replace completely:
import{Hydra,HydraResponse}from'alcaeus/web'constdefaultCacheHeaders=Hydra.cacheStrategy.requestCacheHeadersHydra.cacheStrategy.requestCacheHeaders=(previous: HydraResponse)=>{if(previous.response.effectiveUri.startsWith('https://www.w3.org/ns/hydra/core#')){// no cache for Hydrareturnnull}returndefaultCacheHeaders(previous)}
You could be better off bundling shared vocabularies inside your application using @zazuko/rdf-vocabularies
Watch out for PR zazuko/rdf-vocabularies#74 which will allow importing the packaged vocabularies statically, synchronously and without requiring a parser
I'm getting
It would be nice to disable any caching-related headers so I could avoid this issue. I tried passing
{"if-modified-since": undefined}
as the second argument toHydra.loadResource
, but no luck, this actually led to the issue occurring on more URLs.The text was updated successfully, but these errors were encountered: