metaeducation / ren-c

Library for embedding a Rebol interpreter into C codebases
GNU Lesser General Public License v3.0
128 stars 27 forks source link

CORS access doesn't work #1079

Closed IngoHohmann closed 4 years ago

IngoHohmann commented 4 years ago

At least CORS to gitub doesn't work, I can't currently test other pages (I don't know any which should work).

>> redbol
‌Ren-C has many changes (e.g. replacing TYPE? with TYPE OF, where
... part skipped 
‌Fetching %redbol.reb from GitHub...

And in the developer console:

RuntimeError: unreachable executed libr3-396b437.js:1911:5
Uncaught Error: undefined libr3-396b437.js:1916:10
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://raw.githubusercontent.com/metaeducation/ren-c/master/scripts/redbol.reb. (Reason: CORS request did not succeed).

TypeError: NetworkError when attempting to fetch resource. libr3-396b437.js:5414:11
Uncaught (in promise) TypeError: NetworkError when attempting to fetch resource.
hostilefork commented 4 years ago

I'm not getting that error... and got different errors in both Firefox and Chrome.

I fixed the Chrome error by changing some GETs to GET/ANY. The emulation was trying to reference non-existent functions in the web build (CALL*, FILE-TO-LOCAL, LOCAL-TO-FILE) and that's now an error with a plain GET-WORD!.

However, Firefox is just giving some enigmatic "unreachable" error. Would take research to figure that out. Everything is a moving target with this stuff, it keeps changing. :-(

But it seems that Chrome has no problem reading that URL. Maybe you could do some digging to figure out what's wrong (e.g. try reading that from a plain JS script with fetch() in your browser and see if you get the same error...)

IngoHohmann commented 4 years ago

First off, sorry, this is Firefox 81.0 on Linux.

And a plain fetch doesn't work either, but works from chrome, where CORS from Rebol works as well. Isn't it fun :-/

I'll try to test from other firefox versions.

IngoHohmann commented 4 years ago

Just when I posted this, I found out that it was a plugin interfering with CORS requests.

Now loading works again.

Thank you for the idea of trying plain fetch, which helped to point me in the right direction.