-
Notifications
You must be signed in to change notification settings - Fork 57
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
Token not included in Sprite request when sprite
property in style is a full URL
#188
Comments
Just checking in on the progress on this? We have a client with a pending production release that's dependent on this fix |
@gavinr-maps @mstiglingh there are security considerations here. We cannot blindly send a users token to an external URL over L.esri.Vector.vectorTileLayer("XYZ", {
token: result.access_token,
style: (style) => {
// manually add the token here
return style;
}
}).addTo(map); |
The fix for this was released in v4.2.0. |
@gavinr-maps the issue seems to have returned in the latest versions |
@mstiglingh thanks for the note. The unit tests included in the fix for this (#192) seem to be passing, so I'm not sure what you're seeing. Could you please provide some more details including a replication case and what version the issue started happening? Thanks! |
Describe the bug
(original issue: #186)
This bug is regarding when using a protected vector tile service and thus passing a
token
property in the options object (second parameter) like this:That token should be passed to the request for the sprites too, but in some cases it is not being included:
When the
sprite
property of the style JSON (root.json
) is NOT a full URL starting withhttp....
,When the
sprite
property of the style JSON (root.json
) IS a full URL starting withhttp...
,Reproduction
Logs
No response
System Info
Additional Information
I think this is where the issue is:
esri-leaflet-vector/src/Util.js
Lines 207 to 216 in cad5b19
The fix should be as simple as moving the line that adds the token (
style.sprite += token ? '?token=' + token : '';
) out of thatif
statement.Template
Here is the demo template that is used in the replication steps above. See places where the string "XYZ" are for places where you need to replace values.
The text was updated successfully, but these errors were encountered: