How do the xsrf tokens get inserted into urls?

Ask the url resolver to transform the link, like the rendermime does: https://github.com/jupyterlab/jupyterlab/blob/fa54a84033c1010ea5eed170b682c98c64f6f63e/packages/rendermime/src/renderers.ts#L714