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.
ion asset caching was essentially broken because sending the access token in the query string would bust the cache. The initial fix was to allow the token in the Authorization header, which fixed caching but triggered a preflight request for every tile request (due to CORS), this adds unnecessary overhead. To work around this CORS limitation, the ion servers also support including the token in the
Accept
header, which is non-standard but perfectly legal and does not trigger a pre-flight.Unfortunately, including token in the Accept header means we can no longer vary the accept header to handle terrain extensions. Cesium ion supports passing extensions via query parameters, so
CesiumTerrainProvider
now detects an ion resource and uses query parameters for them.Also turned the private and static function
Resource._makeRequest
into a prototype function so that I could override itIonResource
. This actually opens the way for some future simplification ofIonResource
, but that's definitely a separate PR.CC @shunter @tfili