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

CORS - Credential issue #241

Open
sylvainbeo opened this issue Oct 20, 2019 · 4 comments
Open

CORS - Credential issue #241

sylvainbeo opened this issue Oct 20, 2019 · 4 comments

Comments

@sylvainbeo
Copy link

Hi,

I saw that 'same-origin' is used for the credentials when fetching the style.
Shouldn't this be parametrable ? So we could call olms giving that parameter.

In my case, i need to set "include", but i cannot.

What do you think ?

Thank you for the work.

@ahocevar
Copy link
Member

For the style, you can pass an object instead of a url. Then you could do something like

fetch(styleUrl, {credentials: 'include'}).then(response => {
  response.json().then(style => {
    olms('map', style);
  });
});

@sylvainbeo
Copy link
Author

@ahocevar I don't think it will work, because "same-origin" is also hard coded in the applyStyle function. And that one cannot be avoided i think.

@ahocevar
Copy link
Member

We could either expose a global fetch options object, or you could use a fetch wrapper as additional entry point in your webpack config. If you prefer the former, we'd appreciate a pull request.

@sylvainbeo
Copy link
Author

@ahocevar For the moment, i found a solution just by configuring my nginx in a better way. But i keep that ticket in mind. Thank you for you time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants