Repository navigation
Conversation
kkaefer
force-pushed
the
fetch
branch
3 times, most recently
from
October 5, 2018 17:06
14c65f9 to
729ea91
Compare
kkaefer
commented
Oct 5, 2018
|
|
||
| this._resetUpdates(); | ||
|
|
||
| this.dispatcher.broadcast('setReferrer', getReferrer()); |
Member
Author
There was a problem hiding this comment.
We are dispatching the referrer to the workers when we set up the Style object. On single page applications, the pathname may change, but we'll continue to use the initial pathname. Should we rebroadcast a new pathname?
kkaefer
commented
Oct 5, 2018
| t.end(); | ||
| }); | ||
| window.server.respond(); | ||
| }); |
Member
Author
There was a problem hiding this comment.
I've removed the special casing for empty array buffers. There's nothing inherently wrong with empty 200 responses. The reason we originally added this special case is for images that had an empty response, but that is already handled directly in the getImage call.
kkaefer
commented
Oct 5, 2018
| config.ACCESS_TOKEN = null; | ||
|
|
||
| event.postTurnstileEvent([' a.tiles.mapxbox.com']); | ||
| event.postTurnstileEvent(mapboxTileURLs); |
Member
Author
There was a problem hiding this comment.
We're passing full tile URLs from the TileJSON file here, not just host names.
mourner
approved these changes
Oct 8, 2018
2 of 5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We're currently using the XmlHttpRequest to retrieve data like tiles from the backend server.
This PR switches to the Fetch API where it is supported to enable sending correct referrers from the worker bundle. XHR requests don't send a correct referrer for code from a blob URL worker bundle in Safari, Chrome and Edge (and the
Refererheader is disallowed in this API), while the Fetch API allows us to correctly set the page's referrer URL, as demonstrated by this small snippet:Launch Checklist