-
Notifications
You must be signed in to change notification settings - Fork 8
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
Minimal include support for local editing #124
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
||
function checkForRelativePath(path: string) { | ||
if (path.includes('..')) { | ||
throw new Error('Path must not include any relative path parts') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd log the bad path here and say "include path", not just path, to make it easier to figure out the problem. Might also say "no directory traversal with .." instead of "no relative path parts", I'm not sure the latter is recognizable enough. And as far as I can tell, you actually require the path itself to be relative to the RFD dir. So something like:
throw new Error(`Directory traversal with ".." is not allowed in include:: path. Bad path is ${path}. Included path must be relative to RFD dir ${localRepo}/rfd/${numStr}.`)
Adds rudimentary support for includes during local editing that roughly matches include handling by the RFD API.