-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Disallow relative module specifies that don't start with "./", "../" #1830
Conversation
fn is_absolute(module_name: &str) -> bool { | ||
module_name.starts_with("/") || module_name.starts_with("file://") | ||
} | ||
|
||
fn parse_local_or_remote(p: &str) -> Result<url::Url, url::ParseError> { | ||
if is_remote(p) || p.starts_with("file:") { | ||
Url::parse(p) |
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.
Can you add a unit test to the bottom of this file that demos the change?
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.
Nice!
@ry I submitted some test cases, and the deno_std code has been merged, but I don't know why CI still failed, because it seems that the deno_std/testing code is still the previous one. |
deno_std has to be upgraded manually - which I'm trying to do here: #1833 |
@manyuanrong Could you please rebase? I think it should work now. |
* 'master' of https://github.com/manyuanrong/deno: Add tests case for specifier prefix checker Disallow relative module specifies that don't start with "./", "../", "/"
There still seems to be a problem with appveyor, but I'm sorry I don't know why. I tried to find the reason, but unfortunately I failed. |
For the error in |
Thanks for the PR @manyuanrong, this got the ball rolling which eventually resulted in #2084 - solving the issue. There was some infrastructure work to do first, which is why this wasn't merged. |
Closes #1769