-
Notifications
You must be signed in to change notification settings - Fork 49
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
fetch: allow colons (:) in dataset URLs #702
Comments
Since the colon (:) is reserved as the separator for dual tree displays, URLs that include colons result 404 errors as the nextstrain.org server splits paths on the colon.¹ This results in a 404 error as the dataset URL is truncated (e.g. when trying to load Nextclade dataset ref trees)² We may update the nextstrain.org server to handle colons in dataset URLs in the future, but better to note this behavior now in case others run into the same issue. ¹ https://github.com/nextstrain/nextstrain.org/blob/221c67e5dad919edea65787bc11e4cc2227c42ce/src/endpoints/sources.js#L263 ² nextstrain/nextstrain.org#702
Since the colon (:) is reserved as the separator for dual tree displays, the nextstrain.org server splits paths on the colon.¹ This results in a 404 error as the dataset URL is truncated (e.g. when trying to load Nextclade dataset ref trees)² We may update the nextstrain.org server to handle colons in dataset URLs in the future, but better to note this behavior now in case others run into the same issue. ¹ https://github.com/nextstrain/nextstrain.org/blob/221c67e5dad919edea65787bc11e4cc2227c42ce/src/endpoints/sources.js#L263 ² nextstrain/nextstrain.org#702
A workaround already exists via double-encoding, e.g. However, Auspice (I believe) updates the URL after load and ends up only singly-encoding colons so the displayed URL isn't usable as is (e.g. reloading the page doesn't work). We could potentially update Auspice to DTRT here when it gets an encoded colon. |
To allow
Yeah, Auspice is doing a single round of URL decoding. Happy for changes to Auspice to be proposed here. BTW Auspice logs this change, e.g. for your link above:
|
Context
The colon (
:
) is reserved as separator for the dual tree display, so we explicitly split all paths by colon.This results in 404 errors when loading URLs with colons through
/fetch
For example, Nextclade dataset reference trees with timestamps in the URL cannot load since the URL gets truncated:
https://nextstrain.org/fetch/data.clades.nextstrain.org/datasets/flu_h3n2_ha/references/EPI1857216/versions/2023-04-02T12:00:00Z/files/tree.json
This behavior was reported by @corneliusroemer on Slack.
The text was updated successfully, but these errors were encountered: