redirectFor

open override fun redirectFor(responseUrl: String, body: String): String?

Ask the provider whether a successful tileset fetch should redirect to a different URL. Returns the new URL when the response is itself a redirect envelope (e.g. Cesium Ion's api.cesium.com/v1/assets/<id>/endpoint returns JSON with url + accessToken fields; the actual tileset.json lives at the returned URL), or null when body is the final tileset.json content.

The fetch queue uses this to follow redirects in a bounded loop (see TileFetchQueue.MAX_REDIRECT_HOPS). Providers that don't need redirect logic — most — accept the default null return. Providers that do should also update their internal state (typically the bearer token they'll attach in subsequent rewriteRequest calls) here, since this hook runs before the redirected request goes out.