Repository navigation
Conversation
A resource URL may be a path starting with a single "/", which the portal serves relative to its own host, so study data does not have to name the host it will be served from. Absolute URLs still need a scheme and a host; "//host" and paths without the leading "/" are rejected. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A resource URL is accepted only as an absolute http or https URL with a host (scheme case-insensitive) or a path starting with a single "/". Backslashes and control characters are rejected anywhere, since browsers read "\" as "/" and drop control characters, which would turn "/\host" or "\\host" into a link to another host. Other schemes (javascript:, data:, ftp:, ...) are rejected. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
validateData.pyaccepts a resourceURLin two forms:http://orhttps://URL with a host (the scheme is case-insensitive)./, which the portal serves relative to its own host, so study data doesn't need to name the host it is loaded into:Everything else is rejected:
javascript:,data:,ftp:, ...);//host/...(a host without a scheme) and a path without the leading/;\as/and drop control characters, so/\evil.com/xor\\evil.comwould link to another host.The Java importer doesn't check URL format, so it needs no change.
Docs:
docs/File-Formats.mdin cBioPortal/cbioportal (companion PR).Tests:
test_resource_url_may_be_a_path_on_the_portal,test_resource_url_rejects_what_browsers_would_send_elsewhere.test_scripts.sh(194 tests) passes.🤖 Generated with Claude Code