New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CORS Error in article API. Potential fix included. #30
Comments
Hey John, thanks for the report. I'll have to check with Dimitris and the WA team to see if something has changed with the way they require authentication materials to be passed. |
In GitLab by @johnnolan on Sep 18, 2021, 13:32 Legend, thank you Andrew, love the module, shout if you need any help testing. John |
In GitLab by @adrien.schiehle on Sep 18, 2021, 17:05 In this new version, they released the /category/{id} API, that was missing. We will now be able to build back our category tree on FVTT. I was eager to make a little upgrade on the WorldAnvilBrowser in fvtt module, but unfortunately, it's one of the requests that are failing. Requests that are still working:
Requests that are now failing:
|
In GitLab by @adrien.schiehle on Sep 19, 2021, 08:08 Nevermind what I said on categories. The following request works :
I was able to retrieve categories and use them when displaying WorldAnvilBrowser. EDIT: Sorry, I just realized that it hasn't really any link with this Issue name. I sidetracked from subject. But I wanted to share my joy 😇. |
No worries @adrien.schiehle - I'm going to keep this issue about the CORS problem and fix for that (although I think the fix will be needed on the WA side). Let's use a separate issue to explore adding support for the category API! |
In GitLab by @adrien.schiehle on Sep 21, 2021, 02:00 🎉 We can synchronize our articles again ! |
In GitLab by @johnnolan on Sep 18, 2021, 01:24
Clicking the sync button in FoundryVTT for articles causes CORS errors to return from the Article API Endpoint
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at xxxxx (Reason: CORS header 'Access-Control-Allow-Origin' missing)
Using Postman with the same api call I get the same error
curl --location --request GET 'https://www.worldanvil.com/api/aragorn/article/(GUID)?x-application-key=xxx&x-auth-token=xxx
Changing the request from a params to a header gives a success.
curl --location --request GET 'https://www.worldanvil.com/api/aragorn/article/(GUID)' \ --header 'x-application-key: xxx' \ --header 'x-auth-token: xxx'
Would this be solved by changing the folowing lines to use the header instead of params? https://gitlab.com/foundrynet/world-anvil/-/blob/master/module/api.js#L66-67
The text was updated successfully, but these errors were encountered: