-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
Added 'use-credentials' Cors Option to ImageOverlay and TileLayer #6016
Conversation
Hi, Thank you for contributing your first PR here! I like that this new " Unfortunately it may conflict with the already existing {
crossOrigin: true,
crossOriginCredentials: true
} …the Furthermore, there are actually 3 possible states for this attribute:
Therefore we need at least a tristate option.
That would indeed match with @IvanSanchez's #5891 (comment) We could have:
This scheme would require the app developer to explicitly specify It also leaves this string out of the library (saves a few bytes for common case…), and keeps the door open to any other keyword that may appear in the future (how unlikely this may sound). @IvanSanchez @cherniavskii what do you think? |
@ghybs I like proposition of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about reusing the crossOrigin
option for that? We could just use its value for crossOrigin
if a string is supplied, otherwise set to ''
if truthy.
I wasn't too sure how to phrase the docs. Especially the default value, String = false. I didn't do any type checking so setting |
Thank you for the modification to make the PR now re-use the Even though the spec says that an invalid keyword (as Therefore I think we should at least convert As for the docs, you should specify that a Boolean type is possible, using a vertical pipe ( Leaflet/src/map/handler/Map.DoubleClickZoom.js Lines 12 to 17 in ba6f97f
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you four the modifications!
Fixes #5891
I added a new option to set the crossOrigin property to 'use-credentials'. Another solution would be to make crossOrigin a String and set the default value to null. Let the user set crossOrigin as a String.