Skip to content

Conversation

@ericphanson
Copy link
Member

@ericphanson ericphanson commented Nov 25, 2025

I have seen this error come up a few times when subdir is missing or has a typo, which can confuse people. I think if we can pass through those parameters it might call more attention to whatever is wrong.

note: untested

I have seen this error come up a few times when `subdir` is missing or has a typo, which can confuse people. I think if we can pass through those parameters it might call more attention to whatever is wrong.
# Get the (Julia)Project.toml, and make sure it is valid.
toml = gettoml(u.forge, repo, ref, subdir)
toml === nothing && return json(400; error="(Julia)Project.toml was not found")
toml === nothing && return json(400; error="(Julia)Project.toml was not found in repo `$repo` with ref `$ref` and subdir `$subdir`")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

repo, ref, and subdir are untrusted inputs provided by the user, so do we need to escape or sanitize them here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so, since error is just a string no matter what repo/subdir/ref are. So then json should serialize it to a JSON string (i.e. adding escaping if needed). So I can't really see what the issue would be in this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants