Skip to content
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

Provide GeoJSON loader function to prevent 403's #34

Merged
merged 1 commit into from
Aug 19, 2019

Conversation

jgaehring
Copy link
Member

The loader function creates its own XHR request and sets

xhr.withCredentials = true;

so that requests for GeoJSON from the farmOS server are not rejected because they lack the appropriate session cookies.

We'll wait to see if the OpenLayers team approves the PR to set withCredentials as a part of the default loader for vector sources before approving this.

@mstenta
Copy link
Member

mstenta commented Aug 19, 2019

Here is the pull request that @jgaehring referenced: openlayers/openlayers#9865

Let's merge this and reassess if anything changes upstream.

@mstenta mstenta merged commit 3b094f9 into farmOS:master Aug 19, 2019
@mstenta
Copy link
Member

mstenta commented Sep 24, 2019

Update: OpenLayers has added an option to set withCredentials upstream! Huzzah!

I opened a new issue to remove our custom loader function once a new release of OL is available that includes it: #36

@jgaehring jgaehring mentioned this pull request May 20, 2020
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants