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
{{ message }}
This repository has been archived by the owner on Jan 2, 2023. It is now read-only.
I'm syncing a local Deno replica server (v3.0.0) with a local browser app (Earthstar v9.3.2), using the ExtentionSyncHttp extension. However, when the browser starts to sync, it immediately fails due to CORS.
A cross-origin resource sharing (CORS) request was blocked because the response to the associated preflight request failed, had an unsuccessful HTTP status code, and/or was a redirect.
To fix this issue, ensure all CORS preflight OPTIONS requests are answered with a successful HTTP status code (2xx) and do not redirect.
Dealing with the "OPTIONS" request could be added to the extensions/sync_http.ts code as this will also fix the, unfortunately, still existing CORS issue when running a replica server on Glitch.
See screenshot:
One good way to solve this too is that - if you can - to run your web app within a docker image which uses nginx as proxy web server and then you can do a proxy_pass to the Glitch domain from a "local" folder, like "/api"; You will avoid CORS issues because to the browser the requests will look like it's the same domain.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I'm syncing a local Deno replica server (v3.0.0) with a local browser app (Earthstar v9.3.2), using the
ExtentionSyncHttp
extension. However, when the browser starts to sync, it immediately fails due to CORS.Chrome Dev Tools elaborates on this issue:
I solved this by using a modified version of
ExtentionSyncHttp
. Before getting theresponse
object from the syncer, I added this conditional:There is likely a cleaner way to implement it. I don't know if there are other side cases to consider. But this worked for me.
The text was updated successfully, but these errors were encountered: